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

positional $ operator field mismatch

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

      Basic issue is that the matcher records a single array position in match details without any context. There is no validation that the field path of the matched array matches the field path leading to the positional operator.

      > db.f.drop()
      true
      > db.f.save( { a: [ 1, 2, 3 ], b: [ 4, 5, 6 ] } )
      > db.f.update( { a:1,b:6 }, {$set:{'a.$':10}} )
      > db.f.findOne()
      {
      	"_id" : ObjectId("4bc4c770e4db696f077b91d8"),
      	"a" : [
      		1,
      		2,
      		10
      	],
      	"b" : [
      		4,
      		5,
      		6
      	]
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            aaron Aaron Staple
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: