Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14837

Positional Operator matching wrong nested document

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • ALL
    • Hide

      I've put together a gist that can be used to reproduce the problem: https://gist.github.com/ismell/9ae5a9798ae82a1a85de

      As you can see in the results for 2.4 and 2.6 it's selecting the wrong sub document. It seems like its using the index of the dimensions array as the positional index instead of the position matched by the values._id clause.

      Show
      I've put together a gist that can be used to reproduce the problem: https://gist.github.com/ismell/9ae5a9798ae82a1a85de As you can see in the results for 2.4 and 2.6 it's selecting the wrong sub document. It seems like its using the index of the dimensions array as the positional index instead of the position matched by the values._id clause.

      When upgrading from mongo 2.4 to 2.6 the positional operator is matching the incorrect sub document. This causes an update query to incorrectly update the wrong value. The query supplied was produced by Mongoid when using doubly nested models. https://github.com/mongoid/mongoid/issues/3611 is the reported issue.

            Assignee:
            ramon.fernandez@mongodb.com Ramon Fernandez Marina
            Reporter:
            ismell Raul E Rangel
            Votes:
            2 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: