I want to get a record by its _id
like this:
db.user.find({_id : ObjectId("53a095aa4568cb1fef93f681")})
As you can see the record exists:
I think my way is correct according to:
- Why am I unable to find a record by _id in mongodb
- how do I search for an object by its ObjectId in the console?
- Is it ok to use Mongo's "Object ID" as its unique identifier? If so, how can I convert it to a string and look it up by string?
So what's wrong with my code? I'm using RoboMongo.