I use both robomongo and rockmongo as clients for mongo dbs.. suppose I got a collection called Drivers, then searching by id is quite easy:
db.Driver.find({_id:ObjectId('51118447b38639a960000002')})
I recently installed a mongo plugin for Php Storm, however I couldn't figure out how to search for a document by id.. the above query fails:
Ideas?
As per the support forum, you should query as:
{_id: {$oid: '51118447b38639a960000002'}}
{"_id":ObjectId("51118447b38639a960000002")}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With