...

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

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

     1data:
     2    - {_id: 1, x: 11}
     3    - {_id: 2, x: 22}
     4    - {_id: 3, x: 33}
     5    - {_id: 4, x: 44}
     6    - {_id: 5, x: 55}
     7
     8tests:
     9    -
    10        description: "Find with filter"
    11        operation:
    12            name: "find"
    13            arguments:
    14                filter: {_id: 1}
    15
    16        outcome:
    17            result:
    18                - {_id: 1, x: 11}
    19
    20    - 
    21        description: "Find with filter, sort, skip, and limit"
    22        operation: 
    23            name: "find"
    24            arguments:
    25                filter: 
    26                    _id: {$gt: 2}
    27                sort: {_id: 1}
    28                skip: 2
    29                limit: 2
    30
    31        outcome:
    32            result:
    33                - {_id: 5, x: 55}
    34    -
    35        description: "Find with limit, sort, and batchsize"
    36        operation: 
    37            name: "find"
    38            arguments:
    39                filter: {}
    40                sort: {_id: 1}
    41                limit: 4
    42                batchSize: 2
    43
    44        outcome:
    45            result:
    46                - {_id: 1, x: 11}
    47                - {_id: 2, x: 22}
    48                - {_id: 3, x: 33}
    49                - {_id: 4, x: 44}

View as plain text