DDCODE

Share programming skills from Magic Oriental

upArrow

How does mongodb remove a field from all document under a collection?

 May 12, 2019   mongodb, question

Some document contain a field, others do not.
What should I do to remove a field from all document under a collection?

mongo shell

db.foo.update({}, {$unset: {bar: true}}, {multi: true});

Related Posts:

  • How does MongoDB query a single field of all data…
  • Now there is a mysql table with a tree structure.…
  • Does MongoDB prefer to put all data under one Collection?
  • How to understand the meaning of three words of…
  • The Mongodb Mapreduce output option is replace to a…
  • In Mongodb, should I build another collection for…
  • How to safely transfer the collection and index…
  • The collection created by mongodb cannot be deleted…
  • How does pymongo extract all keys stored in the…
<< Mongodb’s thread pool setting does not work C# development mongodb, use the official website driver or samus driver? >>

Related Posts:

  • How does MongoDB query a single field of all data…
  • Now there is a mysql table with a tree structure.…
  • Does MongoDB prefer to put all data under one Collection?
  • How to understand the meaning of three words of…
  • The Mongodb Mapreduce output option is replace to a…
  • In Mongodb, should I build another collection for…
  • How to safely transfer the collection and index…
  • The collection created by mongodb cannot be deleted…
  • How does pymongo extract all keys stored in the…

Tags

Android android-studio apache c c++ centos Css css3 Database Docker Eclipse Express Front end git GitHub golang Html html5 Ios java javascript Jquery Laravel linux macos mongodb mysql Nginx node.js npm objective-c php Programmer python redis ruby shell Spring Sql Swift ubuntu vim vue.js Web xcode

Powered by MyWiki WordPress Theme