{
  "description": "aggregate with $out/$merge does not set txnNumber",
  "schemaVersion": "1.3",
  "runOnRequirements": [
    {
      "minServerVersion": "3.6",
      "topologies": [
        "replicaset",
        "sharded",
        "load-balanced"
      ]
    }
  ],
  "createEntities": [
    {
      "client": {
        "id": "client0",
        "observeEvents": [
          "commandStartedEvent"
        ]
      }
    },
    {
      "database": {
        "id": "database0",
        "client": "client0",
        "databaseName": "retryable-writes-tests"
      }
    },
    {
      "collection": {
        "id": "collection0",
        "database": "database0",
        "collectionName": "coll0"
      }
    }
  ],
  "initialData": [
    {
      "collectionName": "mergeCollection",
      "databaseName": "retryable-writes-tests",
      "documents": []
    }
  ],
  "tests": [
    {
      "description": "aggregate with $out does not set txnNumber",
      "operations": [
        {
          "object": "collection0",
          "name": "aggregate",
          "arguments": {
            "pipeline": [
              {
                "$sort": {
                  "x": 1
                }
              },
              {
                "$match": {
                  "_id": {
                    "$gt": 1
                  }
                }
              },
              {
                "$out": "outCollection"
              }
            ]
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client0",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "command": {
                  "txnNumber": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "aggregate with $merge does not set txnNumber",
      "runOnRequirements": [
        {
          "minServerVersion": "4.1.11"
        }
      ],
      "operations": [
        {
          "object": "collection0",
          "name": "aggregate",
          "arguments": {
            "pipeline": [
              {
                "$sort": {
                  "x": 1
                }
              },
              {
                "$match": {
                  "_id": {
                    "$gt": 1
                  }
                }
              },
              {
                "$merge": {
                  "into": "mergeCollection"
                }
              }
            ]
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client0",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "command": {
                  "txnNumber": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    }
  ]
}
