...

Text file src/go.mongodb.org/mongo-driver/testdata/sessions/snapshot-sessions-not-supported-server-error.yml

Documentation: go.mongodb.org/mongo-driver/testdata/sessions

     1description: snapshot-sessions-not-supported-server-error
     2
     3schemaVersion: "1.0"
     4
     5runOnRequirements:
     6  - minServerVersion: "5.0"
     7    topologies: [ single ]
     8
     9createEntities:
    10  - client:
    11      id: &client0 client0
    12      observeEvents: [ commandStartedEvent, commandFailedEvent ]
    13  - database:
    14      id: &database0Name database0
    15      client: *client0
    16      databaseName: *database0Name
    17  - collection:
    18      id: &collection0Name collection0
    19      database: *database0Name
    20      collectionName: *collection0Name
    21  - session:
    22      id: session0
    23      client: client0
    24      sessionOptions:
    25        snapshot: true
    26
    27initialData:
    28  - collectionName: *collection0Name
    29    databaseName: *database0Name
    30    documents:
    31      - { _id: 1, x: 11 }
    32
    33tests:
    34- description: Server returns an error on find with snapshot
    35  operations:
    36  - name: find
    37    object: collection0
    38    arguments:
    39      session: session0
    40      filter: {}
    41    expectError:
    42      isError: true
    43      isClientError: false
    44  expectEvents:
    45  - client: client0
    46    events:
    47    - commandStartedEvent:
    48        command:
    49          find: collection0
    50          readConcern:
    51            level: snapshot
    52            atClusterTime:
    53              "$$exists": false
    54    - commandFailedEvent:
    55        commandName: find
    56
    57- description: Server returns an error on aggregate with snapshot
    58  operations:
    59  - name: aggregate
    60    object: collection0
    61    arguments:
    62      session: session0
    63      pipeline: []
    64    expectError:
    65      isError: true
    66      isClientError: false
    67  expectEvents:
    68  - client: client0
    69    events:
    70    - commandStartedEvent:
    71        command:
    72          aggregate: collection0
    73          readConcern:
    74            level: snapshot
    75            atClusterTime:
    76              "$$exists": false
    77    - commandFailedEvent:
    78        commandName: aggregate
    79
    80- description: Server returns an error on distinct with snapshot
    81  operations:
    82  - name: distinct
    83    object: collection0
    84    arguments:
    85      fieldName: x
    86      filter: {}
    87      session: session0
    88    expectError:
    89      isError: true
    90      isClientError: false
    91  expectEvents:
    92  - client: client0
    93    events:
    94    - commandStartedEvent:
    95        command:
    96          distinct: collection0
    97          readConcern:
    98            level: snapshot
    99            atClusterTime:
   100              "$$exists": false
   101    - commandFailedEvent:
   102        commandName: distinct

View as plain text