...

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

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

     1{
     2  "description": "find",
     3  "schemaVersion": "1.0",
     4  "createEntities": [
     5    {
     6      "client": {
     7        "id": "client0",
     8        "useMultipleMongoses": true,
     9        "observeEvents": [
    10          "commandStartedEvent"
    11        ]
    12      }
    13    },
    14    {
    15      "database": {
    16        "id": "database0",
    17        "client": "client0",
    18        "databaseName": "find-tests"
    19      }
    20    },
    21    {
    22      "collection": {
    23        "id": "collection0",
    24        "database": "database0",
    25        "collectionName": "coll0"
    26      }
    27    }
    28  ],
    29  "initialData": [
    30    {
    31      "collectionName": "coll0",
    32      "databaseName": "find-tests",
    33      "documents": [
    34        {
    35          "_id": 1,
    36          "x": 11
    37        },
    38        {
    39          "_id": 2,
    40          "x": 22
    41        },
    42        {
    43          "_id": 3,
    44          "x": 33
    45        },
    46        {
    47          "_id": 4,
    48          "x": 44
    49        },
    50        {
    51          "_id": 5,
    52          "x": 55
    53        },
    54        {
    55          "_id": 6,
    56          "x": 66
    57        }
    58      ]
    59    }
    60  ],
    61  "tests": [
    62    {
    63      "description": "find with multiple batches works",
    64      "operations": [
    65        {
    66          "name": "find",
    67          "arguments": {
    68            "filter": {
    69              "_id": {
    70                "$gt": 1
    71              }
    72            },
    73            "batchSize": 2
    74          },
    75          "object": "collection0",
    76          "expectResult": [
    77            {
    78              "_id": 2,
    79              "x": 22
    80            },
    81            {
    82              "_id": 3,
    83              "x": 33
    84            },
    85            {
    86              "_id": 4,
    87              "x": 44
    88            },
    89            {
    90              "_id": 5,
    91              "x": 55
    92            },
    93            {
    94              "_id": 6,
    95              "x": 66
    96            }
    97          ]
    98        }
    99      ],
   100      "expectEvents": [
   101        {
   102          "client": "client0",
   103          "events": [
   104            {
   105              "commandStartedEvent": {
   106                "command": {
   107                  "find": "coll0",
   108                  "filter": {
   109                    "_id": {
   110                      "$gt": 1
   111                    }
   112                  },
   113                  "batchSize": 2
   114                },
   115                "commandName": "find",
   116                "databaseName": "find-tests"
   117              }
   118            },
   119            {
   120              "commandStartedEvent": {
   121                "command": {
   122                  "getMore": {
   123                    "$$type": [
   124                      "int",
   125                      "long"
   126                    ]
   127                  },
   128                  "collection": "coll0",
   129                  "batchSize": 2
   130                },
   131                "commandName": "getMore",
   132                "databaseName": "find-tests"
   133              }
   134            },
   135            {
   136              "commandStartedEvent": {
   137                "command": {
   138                  "getMore": {
   139                    "$$type": [
   140                      "int",
   141                      "long"
   142                    ]
   143                  },
   144                  "collection": "coll0",
   145                  "batchSize": 2
   146                },
   147                "commandName": "getMore",
   148                "databaseName": "find-tests"
   149              }
   150            }
   151          ]
   152        }
   153      ]
   154    }
   155  ]
   156}

View as plain text