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

Order of keys in embedded document need to be enforced

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0ALPHA1, 1.0.0ALPHA2, 1.0.0BETA1
    • Fix Version/s: 1.0.0BETA2
    • Component/s: Persister
    • Labels:
      None

      Description

      Order of keys in embedded bson hashes in mongodb matters, so you can't $pullAll an embedded document if the order of keys is different from the one in mongodb:

      code
      {
      _id: ObjectId('123'),
      addresses: [

      { street: 'SomeStreet', zipCode: '11111' }

      ,

      { zipCode: '22222', street: 'AnotherStreet' }

      ,
      ]
      }
      /code

      then query like:

      code
      db.collection.update({_id: ObjectId('123')}, {$pullAll: {addresses: [

      { zipCode: '11111', street: 'SomeStreet' }

      ]}})
      /code

      would fail, because the order of keys ('zipCode', 'street') is different from the one stored in mongo ('street', 'zipCode'). More can be found here http://jira.mongodb.org/browse/SERVER-1914

      Therefore, we need to force the order on every insert and update for consistency.

        Activity

        Bulat Shakirzyanov created issue -
        Hide
        Jonathan H. Wage added a comment -

        This is not a problem anymore after the recent refactoring!

        Show
        Jonathan H. Wage added a comment - This is not a problem anymore after the recent refactoring!
        Jonathan H. Wage made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

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

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

          People

          • Assignee:
            Bulat Shakirzyanov
            Reporter:
            Bulat Shakirzyanov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: