- Stitch >
- MongoDB Atlas >
- Reference >
- MongoDB Actions
collection.deleteMany()¶
On this page
Definition¶
-
collection.
deleteMany
()¶
Remove one or more documents from the collection based on a query filter.
Usage¶
Example¶
- Functions
- JavaScript SDK
- Android SDK
- iOS SDK
To call the collection.deleteMany()
action from a
Function, get a collection handle with
database.collection()
then call the handle’s
deleteMany()
method.
To call the collection.deleteMany()
action from a
JavaScript SDK, use the RemoteMongoCollection.deleteMany() method.
To call the collection.deleteMany()
action from the
Java/Android SDK, use the RemoteMongoCollection.deleteMany() method.
To call the collection.deleteMany()
action from the
Swift/iOS SDK, use the RemoteMongoCollection.deleteMany() method.
Parameters¶
- Functions
- JavaScript SDK
- Android SDK
- iOS SDK
The collection.deleteMany()
action has the following form:
Parameter | Description |
---|---|
Query Filter query: <document> |
Optional. A standard MongoDB query document that specifies which documents to delete. You can use most query selectors except for evaluation, geospatial, or bitwise selectors. |
The deleteMany() method has the following form:
Parameter | Description |
---|---|
Query Filter query: <document> |
Optional. A standard MongoDB query document that specifies which documents to delete. You can use most query selectors except for evaluation, geospatial, or bitwise selectors. |
The deleteMany() method has the following form:
Parameter | Description |
---|---|
Query Filter query: <document> |
Optional. A standard MongoDB query document that specifies which documents to delete. You can use most query selectors except for evaluation, geospatial, or bitwise selectors. |
The deleteMany() method has the following form:
Parameter | Description |
---|---|
Query Filter query: <document> |
Optional. A standard MongoDB query document that specifies which documents to delete. You can use most query selectors except for evaluation, geospatial, or bitwise selectors. |
Return Value¶
- Functions
- JavaScript SDK
- Android SDK
- iOS SDK
The collection.deleteMany()
action returns a Promise that
resolves to a document that describes the delete operation.
The RemoteMongoCollection.deleteMany() method returns a Promise that resolves to a RemoteDeleteResult object that describes the delete operation.
The RemoteMongoCollection.deleteMany() method returns a Task that resolves to a RemoteDeleteResult object that describes the delete operation.
The RemoteMongoCollection.deleteMany() method returns a StitchResult enum that resolves to a RemoteDeleteResult object that describes the delete operation.
Value | Description |
---|---|
Matched Count result.deletedCount: <integer> result.deletedCount: <integer> result.deletedCount: <Long> result.deletedCount: <Int> |
The number of documents in the collection that were deleted by the delete operation. |