Search code examples
phpdoctrine-ormodmdollar-signdoctrine-mongodb

In Doctrine, what does dollar sign mean in dot syntax like, property.$.otherProperty?


In Doctrine, what does dollar sign mean in dot syntax like, property.$.otherProperty?

I noticed in /Doctrine/ODM/MongoDB/Tests/Query there is an interesting queryBuilder argument, field('phonenumbers.$.phonenumber') where, in the User class, "phonenumbers" is an @embeddedDocument of class Phonenumber, and in class Phonenumber, "phonenumber" is a @string. My question is... what's this .$. syntax all about?


Solution

  • It's the positional operator from MongoDB.