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

positional $ operator field mismatch

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None

      Description

      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
      	]

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: