Search Results

Search found 2 results on 1 pages for 'user1647484'.

Page 1/1 | 1 

  • Ruby: how to step through ruby code

    - by user1647484
    I'm trying to learn how to step through Ruby code (written by more experienced programmers) in order to improve my knowledge of Ruby. Problem is that I don't really know how to do it well. Googling the topic brought me to an about.com page on Ruby; I thought a higher quality more comprehensive answer should belong on StackOverflow, so if anyone can write an answer (with an example) for it, showing how a beginner can step through code to learn as much as possible about it, it'd be much appreciated.

    Read the article

  • checking mongo database for data

    - by user1647484
    I'm playing around with this tutorial that uses Sinatra, backbone.js, and mongodb for the database. It's my first time using mongo. As far as I understand it the app uses both local storage and a database. it has these routes for the database. For example, it has these routes get '/api/:thing' do DB.collection(params[:thing]).find.to_a.map{|t| from_bson_id(t)}.to_json end get '/api/:thing/:id' do from_bson_id(DB.collection(params[:thing]).find_one(to_bson_id(params[:id]))).to_json end post '/api/:thing' do oid = DB.collection(params[:thing]).insert(JSON.parse(request.body.read.to_s)) "{\"_id\": \"#{oid.to_s}\"}" end After turning the server off and then on, I could see in the server getting data from the database routes 127.0.0.1 - - [17/Sep/2012 08:21:58] "GET /api/todos HTTP/1.1" 200 430 0.0033 My question is, how can I check from within the mongo shell whether the data's in the database? I started the mongo shell ./bin/mongo I selected the database 'use mydb' and then looking at the docs (http://www.mongodb.org/display/DOCS/Tutorial) I tried commands such as > var cursor = db.things.find(); > while (cursor.hasNext()) printjson(cursor.next()); but they didn't return anything.

    Read the article

1