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

$set with array indexes

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.3.0
    • Affects Version/s: None
    • Component/s: Write Ops
    • Labels:
      None

      [fcoury@imac 17:47]:$ mongo
      MongoDB shell version: 0.9.6
      url: test
      connecting to: test
      type "help" for help
      > db.sample.remove();
      > db.sample.save({"_id" : "db1940364a68bbca000000a1" , "test" : [

      {"name" : "domain" , "default" : "" , "validation" : "" , "validation_error" : "" , "label" : "Domain" , "required" : false}

      ]})
      > db.sample.update(

      {"_id":"db1940364a68bbca000000a1"}

      , {$set: {"test.0.new_attribute": "new_value"}})
      > db.sample.find();
      {"_id" : "db1940364a68bbca000000a1" , "test" : [

      {"name" : "domain" , "default" : "" , "validation" : "" , "validation_error" : "" , "label" : "Domain" , "required" : false}

      ]}

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            eliot Eliot Horowitz (Inactive)
            Votes:
            6 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: