...

Text file src/go.mongodb.org/mongo-driver/testdata/crud/v1/read/aggregate-out.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}
     5minServerVersion: '2.6'
     6serverless: 'forbid'
     7
     8tests:
     9    -
    10        description: "Aggregate with $out"
    11        operation:
    12            name: aggregate
    13            arguments:
    14                pipeline:
    15                    - $sort: {x: 1}
    16                    - $match:
    17                        _id: {$gt: 1}
    18                    - $out: "other_test_collection"
    19                batchSize: 2
    20
    21        outcome:
    22            collection:
    23                name: "other_test_collection"
    24                data:
    25                    - {_id: 2, x: 22}
    26                    - {_id: 3, x: 33}
    27    -
    28        description: "Aggregate with $out and batch size of 0"
    29        operation:
    30            name: aggregate
    31            arguments:
    32                pipeline:
    33                    - $sort: {x: 1}
    34                    - $match:
    35                        _id: {$gt: 1}
    36                    - $out: "other_test_collection"
    37                batchSize: 0
    38
    39        outcome:
    40            collection:
    41                name: "other_test_collection"
    42                data:
    43                    - {_id: 2, x: 22}
    44                    - {_id: 3, x: 33}

View as plain text