-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
  • 732,580
  • 175
  • 1,330
  • 1,459
sac Dahal
  • 1,191
  • 2
  • 13
  • 37
  • 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
  • 148
  • 7