When I inserted some documents into a collection (without an ObjectID) mongoDB adds its own ObjectIDs.
I want to query a document by its unique ObjectID.
$db->collection_name->find(array('_id'=>'4e49fd8269fd873c0a000000')));
It does not work either with prefix of MongoID or ObjectID in front of '4e49fd8269fd873c0a000000'.
What is the proper way to query by ObjectID with mongoDB in PHP?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…