description: operation list_collections
schemaVersion: '1.27'
createEntities:
  - client:
      id: &client0 client0
      useMultipleMongoses: false
      observeTracingMessages:
        enableCommandPayload: true
  - database:
      id: &database0 database0
      client: *client0
      databaseName: operation-list-collections
tests:
  - description: List collections
    operations:
      - object: *database0
        name: listCollections

    expectTracingMessages:
       - client: *client0
         ignoreExtraSpans: false
         spans:
           - name: listCollections operation-list-collections
             attributes:
               db.system.name: mongodb
               db.namespace: operation-list-collections
               db.operation.name: listCollections
               db.operation.summary: listCollections operation-list-collections
               db.collection.name: { $$exists: false }

             nested:
               - name: listCollections
                 attributes:
                   db.system.name: mongodb
                   db.namespace: operation-list-collections
                   db.collection.name: { $$exists: false }
                   db.command.name: listCollections
                   network.transport: tcp
                   db.response.status_code: { $$exists: false }
                   exception.message: { $$exists: false }
                   exception.type: { $$exists: false }
                   exception.stacktrace: { $$exists: false }
                   server.address: { $$type: string }
                   server.port: { $$type: [ int, long ] }
                   db.query.summary: listCollections operation-list-collections
                   db.query.text:
                     $$matchAsDocument:
                       $$matchAsRoot:
                         listCollections: 1
                   db.mongodb.server_connection_id:
                     $$type: [ int, long ]
                   db.mongodb.driver_connection_id:
                     $$type: [ int, long ]
