I have this line:
@users = database['users'].find(:all).limit(10)
it returns this object:
<Mongo::Cursor:0x8759a858 namespace='app-development.users' @selector=:all @cursor_id=>
and what I thought was that it has a collection of the 10 users it got from the database. Is that correct? I tried iterating through it like this:
@users.each {
|info|
logger.debug ".....................single user: " + info.inspect
}
but I got this error:
BSON::InvalidDocument (BSON.serialize takes a Hash but got a Symbol):
Help much appreciarted!
I’m not framiliar with mongo but try this:
The #{} allows you to evaluate ruby code within a double quoted string.