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

positional $ operator field mismatch

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Querying
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: