Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search for document by id in Mongo Explorer plugin of php storm

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:

enter image description here

Ideas?

like image 960
abbood Avatar asked Dec 10 '14 06:12

abbood


2 Answers

As per the support forum, you should query as:

{_id: {$oid: '51118447b38639a960000002'}}
like image 129
BatScream Avatar answered Oct 18 '22 22:10

BatScream


{"_id":ObjectId("51118447b38639a960000002")}
like image 35
sorma Gupta Avatar answered Oct 18 '22 21:10

sorma Gupta