...

Text file src/go.mongodb.org/mongo-driver/testdata/index-management/listSearchIndexes.yml

Documentation: go.mongodb.org/mongo-driver/testdata/index-management

     1description: "listSearchIndexes"
     2schemaVersion: "1.4"
     3createEntities:
     4  - client:
     5      id: &client0 client0
     6      useMultipleMongoses: false
     7      observeEvents:
     8        - commandStartedEvent
     9  - database:
    10      id: &database0 database0
    11      client: *client0
    12      databaseName: *database0
    13  - collection:
    14      id: &collection0 collection0
    15      database: *database0
    16      collectionName: *collection0
    17
    18runOnRequirements:
    19  - minServerVersion: "7.0.0"
    20    topologies: [ replicaset, load-balanced, sharded ]
    21    serverless: forbid
    22
    23tests:
    24  - description: "when no name is provided, it does not populate the filter"
    25    operations:
    26      - name: listSearchIndexes
    27        object: *collection0
    28        expectError:
    29          # This test always errors in a non-Atlas environment.  The test functions as a unit test  by asserting
    30          # that the driver constructs and sends the correct command.
    31          # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
    32          isError: true
    33          errorContains: Atlas
    34    expectEvents:
    35      - client: *client0
    36        events:
    37          - commandStartedEvent:
    38              command:
    39                aggregate: *collection0
    40                pipeline:
    41                  - $listSearchIndexes: {}
    42
    43  - description: "when a name is provided, it is present in the filter"
    44    operations:
    45      - name: listSearchIndexes
    46        object: *collection0
    47        arguments: 
    48          name: &indexName "test index"
    49        expectError:
    50          # This test always errors in a non-Atlas environment.  The test functions as a unit test  by asserting
    51          # that the driver constructs and sends the correct command.
    52          # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
    53          isError: true
    54          errorContains: Atlas
    55    expectEvents:
    56      - client: *client0
    57        events:
    58          - commandStartedEvent:
    59              command:
    60                aggregate: *collection0
    61                pipeline:
    62                  - $listSearchIndexes: { name: *indexName }
    63                $db: *database0
    64
    65  - description: aggregation cursor options are supported
    66    operations:
    67      - name: listSearchIndexes
    68        object: *collection0
    69        arguments: 
    70          name: &indexName "test index"
    71          aggregationOptions: 
    72            batchSize: 10
    73        expectError:
    74          # This test always errors in a non-Atlas environment.  The test functions as a unit test  by asserting
    75          # that the driver constructs and sends the correct command.
    76          # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
    77          isError: true
    78          errorContains: Atlas
    79    expectEvents:
    80      - client: *client0
    81        events:
    82          - commandStartedEvent:
    83              command:
    84                aggregate: *collection0
    85                cursor: { batchSize: 10 }
    86                pipeline:
    87                  - $listSearchIndexes: { name: *indexName }
    88                $db: *database0

View as plain text