Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-159

Querying a collection by Embedded objects identifier not working.


    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0.0BETA3
    • Fix Version/s: None
    • Component/s: Persister
    • Labels:
    • Environment:
      OS:10.8.0 OSX
      PHP Official Version 5.3.8
      MongoDB : 2.0.1


      Reference objects identifiers are stored as '$id' in database when Embedded objects identifiers are stored as '_id'. When querying a collection by embedded objects identifier, DocumentPersister->prepareQueryValue() converts it to '$id' although it is stored in DB as '_id'. So querying for reference object ids work but embedded objects do not.

      DocumentPersister->prepareQueryValue() first checks if field has TargetDocument mapping, if it is true it checks if field is target document's identifier, if this also returns true
      it prepares the field as '$id' without looking at if it is Embedded or Reference object ... If TargetDocument it is a Reference object it works since Reference objects identifiers are stored as '$id' but if TargetDocument is Embedded object, query returns empty as theres no field such '$id' in EmbeddedObject, identifier is '_id' instead..

      Is this a bug / issue or am i missing something?


        Dahuda Unal created issue -
        Dahuda Unal made changes -
        Field Original Value New Value
        Affects Version/s 1.0.0BETA3 [ 10124 ]
        Environment OS:10.8.0 OSX
        PHP Official Version 5.3.8
        MongoDB : 2.0.1
        Component/s Persister [ 10059 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to failed: Error in remote call to 'FishEye 0 (' ( [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=MODM-159, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)


          • Assignee:
            Jonathan H. Wage
            Dahuda Unal
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: