...

Text file src/go.mongodb.org/mongo-driver/testdata/crud/unified/replaceOne-hint.yml

Documentation: go.mongodb.org/mongo-driver/testdata/crud/unified

     1# This file was created automatically using mongodb-spec-converter.
     2# Please review the generated file, then remove this notice.
     3
     4description: replaceOne-hint
     5schemaVersion: '1.0'
     6runOnRequirements:
     7  -
     8    minServerVersion: 4.2.0
     9createEntities:
    10  -
    11    client:
    12      id: &client0 client0
    13      observeEvents:
    14        - commandStartedEvent
    15  -
    16    database:
    17      id: &database0 database0
    18      client: client0
    19      databaseName: &database_name crud-v2
    20  -
    21    collection:
    22      id: &collection0 collection0
    23      database: database0
    24      collectionName: &collection_name test_replaceone_hint
    25initialData:
    26  -
    27    collectionName: *collection_name
    28    databaseName: *database_name
    29    documents:
    30      -
    31        _id: 1
    32        x: 11
    33      -
    34        _id: 2
    35        x: 22
    36tests:
    37  -
    38    description: 'ReplaceOne with hint string'
    39    operations:
    40      -
    41        object: *collection0
    42        name: replaceOne
    43        arguments:
    44          filter: &filter
    45            _id:
    46              $gt: 1
    47          replacement: &replacement
    48            x: 111
    49          hint: _id_
    50        expectResult: &result
    51          matchedCount: 1
    52          modifiedCount: 1
    53          upsertedCount: 0
    54    expectEvents:
    55      -
    56        client: *client0
    57        events:
    58          -
    59            commandStartedEvent:
    60              command:
    61                update: *collection_name
    62                updates:
    63                  -
    64                    q: *filter
    65                    u: *replacement
    66                    hint: _id_
    67                    multi: { $$unsetOrMatches: false }
    68                    upsert: { $$unsetOrMatches: false }
    69    outcome: &outcome
    70      -
    71        collectionName: *collection_name
    72        databaseName: *database_name
    73        documents:
    74          -
    75            _id: 1
    76            x: 11
    77          -
    78            _id: 2
    79            x: 111
    80  -
    81    description: 'ReplaceOne with hint document'
    82    operations:
    83      -
    84        object: *collection0
    85        name: replaceOne
    86        arguments:
    87          filter: *filter
    88          replacement: *replacement
    89          hint:
    90            _id: 1
    91        expectResult: *result
    92    expectEvents:
    93      -
    94        client: *client0
    95        events:
    96          -
    97            commandStartedEvent:
    98              command:
    99                update: *collection_name
   100                updates:
   101                  -
   102                    q: *filter
   103                    u: *replacement
   104                    hint:
   105                      _id: 1
   106                    multi: { $$unsetOrMatches: false }
   107                    upsert: { $$unsetOrMatches: false }
   108    outcome: *outcome

View as plain text