Selective deletion of documents: Remove (ARG1,ARG2)
The Remove function does not delete the collection itself, nor does it delete the original index.
Delete all data:
MONGO does not support all * Delete when deleting data, and it can be deleted by selecting {}.
Parameter one: Delete condition, the document that conforms to delete condition will be deleted. (optional)
Parameter two: When True or 1 o'clock, indicates that only one document that meets the criteria is deleted. Optionally, when this is empty, all documents that match the criteria are deleted by default.
Grammar:
Db. Collection_name.remove (deletion_criteria) Delete all documents that match the criteria
Or
>db. Collection_name.remove (deletion_criteria,1) deletes only one document that meets the criteria
Or
>db. Collection_name.remove ({}) Delete all documents in the collection when {} is empty
Delete collection: Drop ()
Db. Collection_name.drop ()
Delete a document in MongoDB, delete a collection