...

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

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

     1{
     2  "data": [
     3    {
     4      "_id": 1,
     5      "x": 11
     6    },
     7    {
     8      "_id": 2,
     9      "x": 22
    10    },
    11    {
    12      "_id": 3,
    13      "x": 33
    14    },
    15    {
    16      "_id": 4,
    17      "x": 44
    18    },
    19    {
    20      "_id": 5,
    21      "x": 55
    22    }
    23  ],
    24  "tests": [
    25    {
    26      "description": "Find with filter",
    27      "operation": {
    28        "name": "find",
    29        "arguments": {
    30          "filter": {
    31            "_id": 1
    32          }
    33        }
    34      },
    35      "outcome": {
    36        "result": [
    37          {
    38            "_id": 1,
    39            "x": 11
    40          }
    41        ]
    42      }
    43    },
    44    {
    45      "description": "Find with filter, sort, skip, and limit",
    46      "operation": {
    47        "name": "find",
    48        "arguments": {
    49          "filter": {
    50            "_id": {
    51              "$gt": 2
    52            }
    53          },
    54          "sort": {
    55            "_id": 1
    56          },
    57          "skip": 2,
    58          "limit": 2
    59        }
    60      },
    61      "outcome": {
    62        "result": [
    63          {
    64            "_id": 5,
    65            "x": 55
    66          }
    67        ]
    68      }
    69    },
    70    {
    71      "description": "Find with limit, sort, and batchsize",
    72      "operation": {
    73        "name": "find",
    74        "arguments": {
    75          "filter": {},
    76          "sort": {
    77            "_id": 1
    78          },
    79          "limit": 4,
    80          "batchSize": 2
    81        }
    82      },
    83      "outcome": {
    84        "result": [
    85          {
    86            "_id": 1,
    87            "x": 11
    88          },
    89          {
    90            "_id": 2,
    91            "x": 22
    92          },
    93          {
    94            "_id": 3,
    95            "x": 33
    96          },
    97          {
    98            "_id": 4,
    99            "x": 44
   100          }
   101        ]
   102      }
   103    }
   104  ]
   105}

View as plain text