{
  "description": "client bulkWrite delete options",
  "schemaVersion": "1.1",
  "runOnRequirements": [
    {
      "minServerVersion": "8.0"
    }
  ],
  "createEntities": [
    {
      "client": {
        "id": "client0",
        "observeEvents": [
          "commandStartedEvent"
        ]
      }
    },
    {
      "database": {
        "id": "database0",
        "client": "client0",
        "databaseName": "crud-tests"
      }
    },
    {
      "collection": {
        "id": "collection0",
        "database": "database0",
        "collectionName": "coll0"
      }
    }
  ],
  "initialData": [
    {
      "collectionName": "coll0",
      "databaseName": "crud-tests",
      "documents": [
        {
          "_id": 1,
          "x": 11
        },
        {
          "_id": 2,
          "x": 22
        },
        {
          "_id": 3,
          "x": 33
        }
      ]
    }
  ],
  "_yamlAnchors": {
    "namespace": "crud-tests.coll0",
    "collation": {
      "locale": "simple"
    },
    "hint": "_id_"
  },
  "tests": [
    {
      "description": "client bulk write delete with collation",
      "operations": [
        {
          "object": "client0",
          "name": "clientBulkWrite",
          "arguments": {
            "models": [
              {
                "deleteOne": {
                  "namespace": "crud-tests.coll0",
                  "filter": {
                    "_id": 1
                  },
                  "collation": {
                    "locale": "simple"
                  }
                }
              },
              {
                "deleteMany": {
                  "namespace": "crud-tests.coll0",
                  "filter": {
                    "_id": {
                      "$gt": 1
                    }
                  },
                  "collation": {
                    "locale": "simple"
                  }
                }
              }
            ],
            "verboseResults": true
          },
          "expectResult": {
            "insertedCount": 0,
            "upsertedCount": 0,
            "matchedCount": 0,
            "modifiedCount": 0,
            "deletedCount": 3,
            "insertResults": {},
            "updateResults": {},
            "deleteResults": {
              "0": {
                "deletedCount": 1
              },
              "1": {
                "deletedCount": 2
              }
            }
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client0",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "bulkWrite",
                "databaseName": "admin",
                "command": {
                  "bulkWrite": 1,
                  "errorsOnly": false,
                  "ordered": true,
                  "ops": [
                    {
                      "delete": 0,
                      "filter": {
                        "_id": 1
                      },
                      "collation": {
                        "locale": "simple"
                      },
                      "multi": false
                    },
                    {
                      "delete": 0,
                      "filter": {
                        "_id": {
                          "$gt": 1
                        }
                      },
                      "collation": {
                        "locale": "simple"
                      },
                      "multi": true
                    }
                  ],
                  "nsInfo": [
                    {
                      "ns": "crud-tests.coll0"
                    }
                  ]
                }
              }
            }
          ]
        }
      ],
      "outcome": [
        {
          "databaseName": "crud-tests",
          "collectionName": "coll0",
          "documents": []
        }
      ]
    },
    {
      "description": "client bulk write delete with hint",
      "operations": [
        {
          "object": "client0",
          "name": "clientBulkWrite",
          "arguments": {
            "models": [
              {
                "deleteOne": {
                  "namespace": "crud-tests.coll0",
                  "filter": {
                    "_id": 1
                  },
                  "hint": "_id_"
                }
              },
              {
                "deleteMany": {
                  "namespace": "crud-tests.coll0",
                  "filter": {
                    "_id": {
                      "$gt": 1
                    }
                  },
                  "hint": "_id_"
                }
              }
            ],
            "verboseResults": true
          },
          "expectResult": {
            "insertedCount": 0,
            "upsertedCount": 0,
            "matchedCount": 0,
            "modifiedCount": 0,
            "deletedCount": 3,
            "insertResults": {},
            "updateResults": {},
            "deleteResults": {
              "0": {
                "deletedCount": 1
              },
              "1": {
                "deletedCount": 2
              }
            }
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client0",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "bulkWrite",
                "databaseName": "admin",
                "command": {
                  "bulkWrite": 1,
                  "errorsOnly": false,
                  "ordered": true,
                  "ops": [
                    {
                      "delete": 0,
                      "filter": {
                        "_id": 1
                      },
                      "hint": "_id_",
                      "multi": false
                    },
                    {
                      "delete": 0,
                      "filter": {
                        "_id": {
                          "$gt": 1
                        }
                      },
                      "hint": "_id_",
                      "multi": true
                    }
                  ]
                }
              }
            }
          ]
        }
      ],
      "outcome": [
        {
          "databaseName": "crud-tests",
          "collectionName": "coll0",
          "documents": []
        }
      ]
    }
  ]
}
