I have a database connection that I got like this:
db = Mongo::Connection.new.db("app-development")
but when I tried querying for a collection like this:
@users = User.all.limit(50)
I got this error:
NoMethodError (undefined method `users' for #<Mongo::DB:0x10ed5f3b8>):
My collection is called users. What was the right way to get that data?
Thanks!
Are you sure that you’ve got the right case on users? is it ‘Users’ or ‘users’?
you could try:
This is the resource I used to learn…
http://api.mongodb.org/ruby/current/file.TUTORIAL.html
Jim