...

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

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

     1{
     2  "description": "snapshot-sessions-not-supported-server-error",
     3  "schemaVersion": "1.0",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "5.0",
     7      "topologies": [
     8        "single"
     9      ]
    10    }
    11  ],
    12  "createEntities": [
    13    {
    14      "client": {
    15        "id": "client0",
    16        "observeEvents": [
    17          "commandStartedEvent",
    18          "commandFailedEvent"
    19        ]
    20      }
    21    },
    22    {
    23      "database": {
    24        "id": "database0",
    25        "client": "client0",
    26        "databaseName": "database0"
    27      }
    28    },
    29    {
    30      "collection": {
    31        "id": "collection0",
    32        "database": "database0",
    33        "collectionName": "collection0"
    34      }
    35    },
    36    {
    37      "session": {
    38        "id": "session0",
    39        "client": "client0",
    40        "sessionOptions": {
    41          "snapshot": true
    42        }
    43      }
    44    }
    45  ],
    46  "initialData": [
    47    {
    48      "collectionName": "collection0",
    49      "databaseName": "database0",
    50      "documents": [
    51        {
    52          "_id": 1,
    53          "x": 11
    54        }
    55      ]
    56    }
    57  ],
    58  "tests": [
    59    {
    60      "description": "Server returns an error on find with snapshot",
    61      "operations": [
    62        {
    63          "name": "find",
    64          "object": "collection0",
    65          "arguments": {
    66            "session": "session0",
    67            "filter": {}
    68          },
    69          "expectError": {
    70            "isError": true,
    71            "isClientError": false
    72          }
    73        }
    74      ],
    75      "expectEvents": [
    76        {
    77          "client": "client0",
    78          "events": [
    79            {
    80              "commandStartedEvent": {
    81                "command": {
    82                  "find": "collection0",
    83                  "readConcern": {
    84                    "level": "snapshot",
    85                    "atClusterTime": {
    86                      "$$exists": false
    87                    }
    88                  }
    89                }
    90              }
    91            },
    92            {
    93              "commandFailedEvent": {
    94                "commandName": "find"
    95              }
    96            }
    97          ]
    98        }
    99      ]
   100    },
   101    {
   102      "description": "Server returns an error on aggregate with snapshot",
   103      "operations": [
   104        {
   105          "name": "aggregate",
   106          "object": "collection0",
   107          "arguments": {
   108            "session": "session0",
   109            "pipeline": []
   110          },
   111          "expectError": {
   112            "isError": true,
   113            "isClientError": false
   114          }
   115        }
   116      ],
   117      "expectEvents": [
   118        {
   119          "client": "client0",
   120          "events": [
   121            {
   122              "commandStartedEvent": {
   123                "command": {
   124                  "aggregate": "collection0",
   125                  "readConcern": {
   126                    "level": "snapshot",
   127                    "atClusterTime": {
   128                      "$$exists": false
   129                    }
   130                  }
   131                }
   132              }
   133            },
   134            {
   135              "commandFailedEvent": {
   136                "commandName": "aggregate"
   137              }
   138            }
   139          ]
   140        }
   141      ]
   142    },
   143    {
   144      "description": "Server returns an error on distinct with snapshot",
   145      "operations": [
   146        {
   147          "name": "distinct",
   148          "object": "collection0",
   149          "arguments": {
   150            "fieldName": "x",
   151            "filter": {},
   152            "session": "session0"
   153          },
   154          "expectError": {
   155            "isError": true,
   156            "isClientError": false
   157          }
   158        }
   159      ],
   160      "expectEvents": [
   161        {
   162          "client": "client0",
   163          "events": [
   164            {
   165              "commandStartedEvent": {
   166                "command": {
   167                  "distinct": "collection0",
   168                  "readConcern": {
   169                    "level": "snapshot",
   170                    "atClusterTime": {
   171                      "$$exists": false
   172                    }
   173                  }
   174                }
   175              }
   176            },
   177            {
   178              "commandFailedEvent": {
   179                "commandName": "distinct"
   180              }
   181            }
   182          ]
   183        }
   184      ]
   185    }
   186  ]
   187}

View as plain text