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

mixing $inc and $push

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

      >

      {"nIndexesWas" : 1 , "msg" : "all indexes deleted for collection" , "ns" : > "businessinsider.test" , "ok" : 1}

      >> db.test.save( { comments: [

      { name: 'blah', rate_up: 0, rate_down: 0, >> rate_ups: [], rate_downs: [] }

      ] } );
      >> db.test.find();
      > {"_id" : ObjectId( "4ac811c90516872d71363660") , "comments" : [

      {"name" : > "blah" , "rate_up" : 0 , "rate_down" : 0 , "rate_ups" : [] , "rate_downs" : > []}

      ]}
      >> db.test.update( {} , { $inc:

      { 'comments.0.rate_up': 1 }

      , $push:

      { >> 'comments.0.rate_ups': 99 }

      } );

            Assignee:
            william.byrne@mongodb.com William Byrne III
            Reporter:
            eliot Eliot Horowitz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: