Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

delete a property from mongodb collection documents

// { name: "book", tags: { words: ["abc", "123"], lat: 33, long: 22 } }
db.collection.updateMany({}, [{ $unset: ["tags.words"] }])
// { name: "book", tags: { lat: 33, long: 22 } }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #property #mongodb #collection #documents
ADD COMMENT
Topic
Name
5+4 =