Update with positional operator with regex selector fails

XMLWordPrintableJSON

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

      > 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 (Inactive)
              Reporter:
              Okku Touronen
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: