Skip to main content
Version: 8.1

system.mongodb.deleteMany

New in 8.1.28

This function is used in Python Scripting.

note

Project Library scripts will not provide hints for MongoDB system functions unless the Script Hint Scope is set to Gateway. See the Scripting in Ignition page for more details on scripting hints.

Description​

Removes documents from the collection that match the filter.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.mongodb.deleteMany(connector, collection, filter, [options])

Parameters​

TypeParameterDescription
StringconnectorThe name of connector (case-insensitive).
StringcollectionThe name of collection (case-sensitive).
PyDictionaryfilterA PyDictionary for specifying matching key value pair criteria when querying a collection.
PyDictionaryoptionsA PyDictionary for including additional delete configurations. [optional]

Returns​

PyDictionary result - Result of delete action formatted as a PyDictionary with keys ‘acknowledged’ and ‘deleteCount’.

Scope​

Gateway, Perspective Session

Code Examples​

Example #1
# Specify unique field values to locate specific documents.
filter = {"qualityControlProcess":"V020"}

# Apply parameters for function call.
print system.mongodb.deleteMany("MongoDB", "data", filter)

Keywords​

system mongodb deleteMany, mongodb.deleteMany