DDCODE

Share programming skills from Magic Oriental

upArrow

Why must mongodb delete documents with ObjectId

 May 12, 2019   mongodb, question

图片描述
Why must Objectid be used to delete documents according to ID?

Although what you see seems to be a string, the _id of document is actually an ObjectId object, so you must use theObjectId()The method converts a string into an object to use

Related Posts:

  • MongoDB: Why is it not good to modify the objectid…
  • Is there any function in MongoDB to find documents…
  • What does the ObjectId function in the…
  • Is the id of the non-primary key in mongodb string…
  • Regarding the modeling of mongodb, some people…
  • How many unique IDs does the random number of the…
  • How does mongodb add, delete, modify and check array…
  • How does mongodb add, delete, modify and check array…
  • Mongo assumes that there are 10 documents in a set.…
<< Mongodb returns 1 whether it exists or not? According to the backup file and oplog restore data to a certain point in time, why can’t the report be restored? >>

Related Posts:

  • MongoDB: Why is it not good to modify the objectid…
  • Is there any function in MongoDB to find documents…
  • What does the ObjectId function in the…
  • Is the id of the non-primary key in mongodb string…
  • Regarding the modeling of mongodb, some people…
  • How many unique IDs does the random number of the…
  • How does mongodb add, delete, modify and check array…
  • How does mongodb add, delete, modify and check array…
  • Mongo assumes that there are 10 documents in a set.…

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