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

Update with positional operator with regex selector fails

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.3
    • Affects Version/s: 1.4.4
    • Component/s: Write Ops
    • None
    • Environment:
      Win 7 64bit

      > db.t3.insert({_id:1,list:[

      {name:"a",val:1}

      ]})
      > db.t3.find()
      { "_id" : 1, "list" : [

      { "name" : "a", "val" : 1 }

      ] }
      > db.t3.update(

      { "list.name" : /^a$/ }

      ,{ $set:

      { "list.$.val" : 2 }

      },false,true)
      can't append to array using string field name

      > db.t3.update(

      { "list.name" : "a" }

      ,{ $set:

      { "list.$.val" : 2 }

      },false,true)
      > db.t3.find()
      { "_id" : 1, "list" : [

      { "name" : "a", "val" : 2 }

      ] }
      >

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            okku Okku Touronen
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: