Doctrine MongoDB find by id

前端 未结 1 1434
一整个雨季
一整个雨季 2021-01-06 16:59

I\'m using odm mongo doctrine and I have to document-classes

class Thing
{
/**
 * @MongoDB\\Id
 */
protected $id;

 /**
  * @MongoDB\\ReferenceOne(targetDocu         


        
相关标签:
1条回答
  • 2021-01-06 17:57

    Try

    ->field('other')->equals(new \MongoId("516c0061975a299edc44b419"))
    

    ObjectId is the internal type for Mongo, represented by \MongoId() in PHP

    ( But i have also answered in the first topic )

    0 讨论(0)
提交回复
热议问题