Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongodb add key value to all documents

db.your_collection.update_many({}, {"$set": {"new_field": "value"}}, upsert=False, array_filters=None)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mongodb #add #key #documents
ADD COMMENT
Topic
Name
6+8 =