I use the odm mongo dogma, and I have class documents
class Thing { protected $id; protected $other; }
and
class Other { protected $id; }
therefore, in the database, the view is as follows:
{ "_id":ObjectId("43z758634875adf"), "other":ObjectId("38z287348d8se") }
How can I now request things where the other is the given identifier?
$dm=$this->mongo->getManager(); $answers=$dm ->createQueryBuilder('Bundle1:Thing') ->field('other')->equals("ObjectId(516c0061975a299edc44b419)")
This causes an incorrect mango request
MongoDB query: {"Find": true, "query": {"other": "ObjectId (516c0061975a299edc44b419)"}, "fields": [], "DB": "maself", "collection": "thing"} [] []
When i use
-> field ('other') → equals ("516c0061975a299edc44b419")
the request is also invalid
MongoDB query: {"Find": true, "query": {"other": "516c0061975a299edc44b419"}, "fields": [], "DB": "maself", "collection": "thing"} [] [ ]
So how can I search for an item where the other id is equal to the id object?