Hey There Im trying to map some documents in a mongodb and everything works perfect like this
/**
* @MongoDB\Id
*/
protected $id;
/**
* @MongoDB\Field(type="string",name="text")
*/
protected $text;
but what if i have a field with a refference to another document with an Object id like :
...
other:ObjectId("823789473938ab"),
...
but what do i have to set as type ?
/**
* @MongoDB\Field(type="?",name="other")
*/
protected $other;
when i use the annotation above@MongoDB\Id
it fails
i also tryed to use refferencene like
* @MongoDB\ReferenceOne(targetDocument="Bundle1:Other")
leaving it argumentless always returns 0 when i do sth like this somewhere else
$others=$dm
->createQueryBuilder('Bundle1:Thing')
->field('other')
->equals('ObjectId("516c0061975a299edc44b419")')
->getQuery()
->execute()->count();
the query looks like :
doctrine.INFO: MongoDB query: {"find":true,"query":{"other":"ObjectId(\"516c0061975a299edc44b419\")"},"fields":[],"db":"maself","collection":"thing"}
so ofcourse theres a zero count, so part of the question also is how to query for all Things where other is a unique mongo id ?
for any help thanks in advance!