I\'ve found this question answered for C# and Perl, but not in the native interface. I thought this would work:
db.theColl.find( { _id: ObjectId(\"4ecbe7f9e8c
If you're using Node.js:
> var ObjectId = require('mongodb').ObjectId; > var id = req.params.gonderi_id; > var o_id = new ObjectId(id); > db.test.find({_id:o_id})
Edit: corrected to new ObjectId(id), not new ObjectID(id)