Skip to main content
Version: 8.1

system.mongodb.listCollectionNames

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​

Returns a list of all collection names.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.mongodb.listCollectionNames(connector)

Parameters​

TypeParameterDescription
StringconnectorName of connector (case-insensitive).

Returns​

List[String] collectionNames - A List of all collection names.

Scope​

Gateway, Perspective Session

Code Examples​

Example #1
# Retrieve a connector name to query from.

connectorList = system.mongodb.listConnectorInfo()

# Iterate through the list of connectors and print out all collection names found.
for connector in connectorList:
print system.mongodb.listCollectionNames(connector['name'])