...

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

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

     1description: "updateSearchIndex"
     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: "sends the correct command"
    25    operations:
    26      - name: updateSearchIndex
    27        object: *collection0
    28        arguments:
    29          name: &indexName 'test index'
    30          definition: &definition {}
    31        expectError:
    32          # This test always errors in a non-Atlas environment.  The test functions as a unit test  by asserting
    33          # that the driver constructs and sends the correct command.
    34          # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
    35          isError: true
    36          errorContains: Atlas
    37    expectEvents:
    38      - client: *client0
    39        events:
    40          - commandStartedEvent:
    41              command:
    42                updateSearchIndex: *collection0
    43                name: *indexName
    44                definition: *definition
    45                $db: *database0

View as plain text