Add key In all MongoDB collection objects

Adding key in all collection object is bit tricky in mongoDB as there is nothing like alter table db.collection.update( criteria, ourobj, upsert, multi ) criteria is used to select objects which will be updated. e.g {“name”:”testName”} ourobject is the document which will be appended or overwrite fields of object found by criteria upsert  stand for update … Read more