...

Text file src/go.mongodb.org/mongo-driver/testdata/sessions/snapshot-sessions-unsupported-ops.json

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

     1{
     2  "description": "snapshot-sessions-unsupported-ops",
     3  "schemaVersion": "1.0",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "5.0",
     7      "topologies": [
     8        "replicaset",
     9        "sharded-replicaset"
    10      ]
    11    }
    12  ],
    13  "createEntities": [
    14    {
    15      "client": {
    16        "id": "client0",
    17        "observeEvents": [
    18          "commandStartedEvent",
    19          "commandFailedEvent"
    20        ]
    21      }
    22    },
    23    {
    24      "database": {
    25        "id": "database0",
    26        "client": "client0",
    27        "databaseName": "database0"
    28      }
    29    },
    30    {
    31      "collection": {
    32        "id": "collection0",
    33        "database": "database0",
    34        "collectionName": "collection0"
    35      }
    36    },
    37    {
    38      "session": {
    39        "id": "session0",
    40        "client": "client0",
    41        "sessionOptions": {
    42          "snapshot": true
    43        }
    44      }
    45    }
    46  ],
    47  "initialData": [
    48    {
    49      "collectionName": "collection0",
    50      "databaseName": "database0",
    51      "documents": [
    52        {
    53          "_id": 1,
    54          "x": 11
    55        }
    56      ]
    57    }
    58  ],
    59  "tests": [
    60    {
    61      "description": "Server returns an error on insertOne with snapshot",
    62      "runOnRequirements": [
    63        {
    64          "topologies": [
    65            "replicaset"
    66          ]
    67        }
    68      ],
    69      "operations": [
    70        {
    71          "name": "insertOne",
    72          "object": "collection0",
    73          "arguments": {
    74            "session": "session0",
    75            "document": {
    76              "_id": 22,
    77              "x": 22
    78            }
    79          },
    80          "expectError": {
    81            "isError": true,
    82            "isClientError": false
    83          }
    84        }
    85      ],
    86      "expectEvents": [
    87        {
    88          "client": "client0",
    89          "events": [
    90            {
    91              "commandStartedEvent": {
    92                "command": {
    93                  "insert": "collection0",
    94                  "readConcern": {
    95                    "level": "snapshot",
    96                    "atClusterTime": {
    97                      "$$exists": false
    98                    }
    99                  }
   100                }
   101              }
   102            },
   103            {
   104              "commandFailedEvent": {
   105                "commandName": "insert"
   106              }
   107            }
   108          ]
   109        }
   110      ]
   111    },
   112    {
   113      "description": "Server returns an error on insertMany with snapshot",
   114      "runOnRequirements": [
   115        {
   116          "topologies": [
   117            "replicaset"
   118          ]
   119        }
   120      ],
   121      "operations": [
   122        {
   123          "name": "insertMany",
   124          "object": "collection0",
   125          "arguments": {
   126            "session": "session0",
   127            "documents": [
   128              {
   129                "_id": 22,
   130                "x": 22
   131              },
   132              {
   133                "_id": 33,
   134                "x": 33
   135              }
   136            ]
   137          },
   138          "expectError": {
   139            "isError": true,
   140            "isClientError": false
   141          }
   142        }
   143      ],
   144      "expectEvents": [
   145        {
   146          "client": "client0",
   147          "events": [
   148            {
   149              "commandStartedEvent": {
   150                "command": {
   151                  "insert": "collection0",
   152                  "readConcern": {
   153                    "level": "snapshot",
   154                    "atClusterTime": {
   155                      "$$exists": false
   156                    }
   157                  }
   158                }
   159              }
   160            },
   161            {
   162              "commandFailedEvent": {
   163                "commandName": "insert"
   164              }
   165            }
   166          ]
   167        }
   168      ]
   169    },
   170    {
   171      "description": "Server returns an error on deleteOne with snapshot",
   172      "runOnRequirements": [
   173        {
   174          "topologies": [
   175            "replicaset"
   176          ]
   177        }
   178      ],
   179      "operations": [
   180        {
   181          "name": "deleteOne",
   182          "object": "collection0",
   183          "arguments": {
   184            "session": "session0",
   185            "filter": {}
   186          },
   187          "expectError": {
   188            "isError": true,
   189            "isClientError": false
   190          }
   191        }
   192      ],
   193      "expectEvents": [
   194        {
   195          "client": "client0",
   196          "events": [
   197            {
   198              "commandStartedEvent": {
   199                "command": {
   200                  "delete": "collection0",
   201                  "readConcern": {
   202                    "level": "snapshot",
   203                    "atClusterTime": {
   204                      "$$exists": false
   205                    }
   206                  }
   207                }
   208              }
   209            },
   210            {
   211              "commandFailedEvent": {
   212                "commandName": "delete"
   213              }
   214            }
   215          ]
   216        }
   217      ]
   218    },
   219    {
   220      "description": "Server returns an error on updateOne with snapshot",
   221      "runOnRequirements": [
   222        {
   223          "topologies": [
   224            "replicaset"
   225          ]
   226        }
   227      ],
   228      "operations": [
   229        {
   230          "name": "updateOne",
   231          "object": "collection0",
   232          "arguments": {
   233            "session": "session0",
   234            "filter": {
   235              "_id": 1
   236            },
   237            "update": {
   238              "$inc": {
   239                "x": 1
   240              }
   241            }
   242          },
   243          "expectError": {
   244            "isError": true,
   245            "isClientError": false
   246          }
   247        }
   248      ],
   249      "expectEvents": [
   250        {
   251          "client": "client0",
   252          "events": [
   253            {
   254              "commandStartedEvent": {
   255                "command": {
   256                  "update": "collection0",
   257                  "readConcern": {
   258                    "level": "snapshot",
   259                    "atClusterTime": {
   260                      "$$exists": false
   261                    }
   262                  }
   263                }
   264              }
   265            },
   266            {
   267              "commandFailedEvent": {
   268                "commandName": "update"
   269              }
   270            }
   271          ]
   272        }
   273      ]
   274    },
   275    {
   276      "description": "Server returns an error on findOneAndUpdate with snapshot",
   277      "operations": [
   278        {
   279          "name": "findOneAndUpdate",
   280          "object": "collection0",
   281          "arguments": {
   282            "session": "session0",
   283            "filter": {
   284              "_id": 1
   285            },
   286            "update": {
   287              "$inc": {
   288                "x": 1
   289              }
   290            }
   291          },
   292          "expectError": {
   293            "isError": true,
   294            "isClientError": false
   295          }
   296        }
   297      ],
   298      "expectEvents": [
   299        {
   300          "client": "client0",
   301          "events": [
   302            {
   303              "commandStartedEvent": {
   304                "command": {
   305                  "findAndModify": "collection0",
   306                  "readConcern": {
   307                    "level": "snapshot",
   308                    "atClusterTime": {
   309                      "$$exists": false
   310                    }
   311                  }
   312                }
   313              }
   314            },
   315            {
   316              "commandFailedEvent": {
   317                "commandName": "findAndModify"
   318              }
   319            }
   320          ]
   321        }
   322      ]
   323    },
   324    {
   325      "description": "Server returns an error on listDatabases with snapshot",
   326      "operations": [
   327        {
   328          "name": "listDatabases",
   329          "object": "client0",
   330          "arguments": {
   331            "session": "session0"
   332          },
   333          "expectError": {
   334            "isError": true,
   335            "isClientError": false
   336          }
   337        }
   338      ],
   339      "expectEvents": [
   340        {
   341          "client": "client0",
   342          "events": [
   343            {
   344              "commandStartedEvent": {
   345                "command": {
   346                  "listDatabases": 1,
   347                  "readConcern": {
   348                    "level": "snapshot",
   349                    "atClusterTime": {
   350                      "$$exists": false
   351                    }
   352                  }
   353                }
   354              }
   355            },
   356            {
   357              "commandFailedEvent": {
   358                "commandName": "listDatabases"
   359              }
   360            }
   361          ]
   362        }
   363      ]
   364    },
   365    {
   366      "description": "Server returns an error on listCollections with snapshot",
   367      "operations": [
   368        {
   369          "name": "listCollections",
   370          "object": "database0",
   371          "arguments": {
   372            "session": "session0"
   373          },
   374          "expectError": {
   375            "isError": true,
   376            "isClientError": false
   377          }
   378        }
   379      ],
   380      "expectEvents": [
   381        {
   382          "client": "client0",
   383          "events": [
   384            {
   385              "commandStartedEvent": {
   386                "command": {
   387                  "listCollections": 1,
   388                  "readConcern": {
   389                    "level": "snapshot",
   390                    "atClusterTime": {
   391                      "$$exists": false
   392                    }
   393                  }
   394                }
   395              }
   396            },
   397            {
   398              "commandFailedEvent": {
   399                "commandName": "listCollections"
   400              }
   401            }
   402          ]
   403        }
   404      ]
   405    },
   406    {
   407      "description": "Server returns an error on listIndexes with snapshot",
   408      "operations": [
   409        {
   410          "name": "listIndexes",
   411          "object": "collection0",
   412          "arguments": {
   413            "session": "session0"
   414          },
   415          "expectError": {
   416            "isError": true,
   417            "isClientError": false
   418          }
   419        }
   420      ],
   421      "expectEvents": [
   422        {
   423          "client": "client0",
   424          "events": [
   425            {
   426              "commandStartedEvent": {
   427                "command": {
   428                  "listIndexes": "collection0",
   429                  "readConcern": {
   430                    "level": "snapshot",
   431                    "atClusterTime": {
   432                      "$$exists": false
   433                    }
   434                  }
   435                }
   436              }
   437            },
   438            {
   439              "commandFailedEvent": {
   440                "commandName": "listIndexes"
   441              }
   442            }
   443          ]
   444        }
   445      ]
   446    },
   447    {
   448      "description": "Server returns an error on runCommand with snapshot",
   449      "operations": [
   450        {
   451          "name": "runCommand",
   452          "object": "database0",
   453          "arguments": {
   454            "session": "session0",
   455            "commandName": "listCollections",
   456            "command": {
   457              "listCollections": 1
   458            }
   459          },
   460          "expectError": {
   461            "isError": true,
   462            "isClientError": false
   463          }
   464        }
   465      ],
   466      "expectEvents": [
   467        {
   468          "client": "client0",
   469          "events": [
   470            {
   471              "commandStartedEvent": {
   472                "command": {
   473                  "listCollections": 1,
   474                  "readConcern": {
   475                    "level": "snapshot",
   476                    "atClusterTime": {
   477                      "$$exists": false
   478                    }
   479                  }
   480                }
   481              }
   482            },
   483            {
   484              "commandFailedEvent": {
   485                "commandName": "listCollections"
   486              }
   487            }
   488          ]
   489        }
   490      ]
   491    }
   492  ]
   493}

View as plain text