-1

Ok my schema structure is:

"labTest" : [ 
        {
            "_id" : ObjectId("56eaab35b5f57f2c1b022b00"),
            "test" : "Blood Test"
        }, 
        {
            "_id" : ObjectId("56eaab35b5f57f2c1b022aff"),
            "test" : "Urine Test"
        }, 
        {
            "_id" : ObjectId("56eaab35b5f57f2c1b022afe"),
            "test" : "ECG"
        }
    ],

Now I have the id and test field to this schema, I just want to query and add a status field inside this schema and make it 1.

Any help will be very appreciated

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
sac Dahal
  • 1,101
  • 1
  • 13
  • 35
  • 1
    Possible duplicate of [How to Update Multiple Array Elements in mongodb](http://stackoverflow.com/questions/4669178/how-to-update-multiple-array-elements-in-mongodb) – Blakes Seven Mar 19 '16 at 07:00

1 Answers1

1

You can do this using commandline very easily. I am considering that your environment is all set. simply type following command in your commandline interface.

db.yourschemaname.update({},{$set:{"status":1}},{multi:true});
Dnyaneshwar
  • 136
  • 6