...

Text file src/go.mongodb.org/mongo-driver/testdata/crud/unified/insertOne-comment.json

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

     1{
     2  "description": "insertOne-comment",
     3  "schemaVersion": "1.0",
     4  "createEntities": [
     5    {
     6      "client": {
     7        "id": "client0",
     8        "observeEvents": [
     9          "commandStartedEvent"
    10        ]
    11      }
    12    },
    13    {
    14      "database": {
    15        "id": "database0",
    16        "client": "client0",
    17        "databaseName": "crud-tests"
    18      }
    19    },
    20    {
    21      "collection": {
    22        "id": "collection0",
    23        "database": "database0",
    24        "collectionName": "coll0"
    25      }
    26    }
    27  ],
    28  "initialData": [
    29    {
    30      "collectionName": "coll0",
    31      "databaseName": "crud-tests",
    32      "documents": [
    33        {
    34          "_id": 1,
    35          "x": 11
    36        }
    37      ]
    38    }
    39  ],
    40  "tests": [
    41    {
    42      "description": "insertOne with string comment",
    43      "runOnRequirements": [
    44        {
    45          "minServerVersion": "4.4"
    46        }
    47      ],
    48      "operations": [
    49        {
    50          "name": "insertOne",
    51          "object": "collection0",
    52          "arguments": {
    53            "document": {
    54              "_id": 2,
    55              "x": 22
    56            },
    57            "comment": "comment"
    58          }
    59        }
    60      ],
    61      "expectEvents": [
    62        {
    63          "client": "client0",
    64          "events": [
    65            {
    66              "commandStartedEvent": {
    67                "command": {
    68                  "insert": "coll0",
    69                  "documents": [
    70                    {
    71                      "_id": 2,
    72                      "x": 22
    73                    }
    74                  ],
    75                  "comment": "comment"
    76                }
    77              }
    78            }
    79          ]
    80        }
    81      ],
    82      "outcome": [
    83        {
    84          "collectionName": "coll0",
    85          "databaseName": "crud-tests",
    86          "documents": [
    87            {
    88              "_id": 1,
    89              "x": 11
    90            },
    91            {
    92              "_id": 2,
    93              "x": 22
    94            }
    95          ]
    96        }
    97      ]
    98    },
    99    {
   100      "description": "insertOne with document comment",
   101      "runOnRequirements": [
   102        {
   103          "minServerVersion": "4.4"
   104        }
   105      ],
   106      "operations": [
   107        {
   108          "name": "insertOne",
   109          "object": "collection0",
   110          "arguments": {
   111            "document": {
   112              "_id": 2,
   113              "x": 22
   114            },
   115            "comment": {
   116              "key": "value"
   117            }
   118          }
   119        }
   120      ],
   121      "expectEvents": [
   122        {
   123          "client": "client0",
   124          "events": [
   125            {
   126              "commandStartedEvent": {
   127                "command": {
   128                  "insert": "coll0",
   129                  "documents": [
   130                    {
   131                      "_id": 2,
   132                      "x": 22
   133                    }
   134                  ],
   135                  "comment": {
   136                    "key": "value"
   137                  }
   138                }
   139              }
   140            }
   141          ]
   142        }
   143      ],
   144      "outcome": [
   145        {
   146          "collectionName": "coll0",
   147          "databaseName": "crud-tests",
   148          "documents": [
   149            {
   150              "_id": 1,
   151              "x": 11
   152            },
   153            {
   154              "_id": 2,
   155              "x": 22
   156            }
   157          ]
   158        }
   159      ]
   160    },
   161    {
   162      "description": "insertOne with comment - pre 4.4",
   163      "runOnRequirements": [
   164        {
   165          "minServerVersion": "3.4.0",
   166          "maxServerVersion": "4.2.99"
   167        }
   168      ],
   169      "operations": [
   170        {
   171          "name": "insertOne",
   172          "object": "collection0",
   173          "arguments": {
   174            "document": {
   175              "_id": 2,
   176              "x": 22
   177            },
   178            "comment": "comment"
   179          },
   180          "expectError": {
   181            "isClientError": false
   182          }
   183        }
   184      ],
   185      "expectEvents": [
   186        {
   187          "client": "client0",
   188          "events": [
   189            {
   190              "commandStartedEvent": {
   191                "command": {
   192                  "insert": "coll0",
   193                  "documents": [
   194                    {
   195                      "_id": 2,
   196                      "x": 22
   197                    }
   198                  ],
   199                  "comment": "comment"
   200                }
   201              }
   202            }
   203          ]
   204        }
   205      ],
   206      "outcome": [
   207        {
   208          "collectionName": "coll0",
   209          "databaseName": "crud-tests",
   210          "documents": [
   211            {
   212              "_id": 1,
   213              "x": 11
   214            }
   215          ]
   216        }
   217      ]
   218    }
   219  ]
   220}

View as plain text