Why must mongodb delete documents with ObjectId

  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