{
  "description": "bulkWrite-collation",
  "schemaVersion": "1.4",
  "runOnRequirements": [
    {
      "minServerVersion": "3.4",
      "serverless": "forbid"
    }
  ],
  "createEntities": [
    {
      "client": {
        "id": "client0"
      }
    },
    {
      "database": {
        "id": "database0",
        "client": "client0",
        "databaseName": "crud-v1"
      }
    },
    {
      "collection": {
        "id": "collection0",
        "database": "database0",
        "collectionName": "coll"
      }
    }
  ],
  "initialData": [
    {
      "collectionName": "coll",
      "databaseName": "crud-v1",
      "documents": [
        {
          "_id": 1,
          "x": 11
        },
        {
          "_id": 2,
          "x": "ping"
        },
        {
          "_id": 3,
          "x": "pINg"
        },
        {
          "_id": 4,
          "x": "pong"
        },
        {
          "_id": 5,
          "x": "pONg"
        }
      ]
    }
  ],
  "tests": [
    {
      "description": "BulkWrite with delete operations and collation",
      "operations": [
        {
          "object": "collection0",
          "name": "bulkWrite",
          "arguments": {
            "requests": [
              {
                "deleteOne": {
                  "filter": {
                    "x": "PING"
                  },
                  "collation": {
                    "locale": "en_US",
                    "strength": 2
                  }
                }
              },
              {
                "deleteOne": {
                  "filter": {
                    "x": "PING"
                  },
                  "collation": {
                    "locale": "en_US",
                    "strength": 2
                  }
                }
              },
              {
                "deleteMany": {
                  "filter": {
                    "x": "PONG"
                  },
                  "collation": {
                    "locale": "en_US",
                    "strength": 2
                  }
                }
              }
            ],
            "ordered": true
          },
          "expectResult": {
            "deletedCount": 4,
            "insertedCount": 0,
            "insertedIds": {
              "$$unsetOrMatches": {}
            },
            "matchedCount": 0,
            "modifiedCount": 0,
            "upsertedCount": 0,
            "upsertedIds": {}
          }
        }
      ],
      "outcome": [
        {
          "collectionName": "coll",
          "databaseName": "crud-v1",
          "documents": [
            {
              "_id": 1,
              "x": 11
            }
          ]
        }
      ]
    },
    {
      "description": "BulkWrite with update operations and collation",
      "operations": [
        {
          "object": "collection0",
          "name": "bulkWrite",
          "arguments": {
            "requests": [
              {
                "updateMany": {
                  "filter": {
                    "x": "ping"
                  },
                  "update": {
                    "$set": {
                      "x": "PONG"
                    }
                  },
                  "collation": {
                    "locale": "en_US",
                    "strength": 3
                  }
                }
              },
              {
                "updateOne": {
                  "filter": {
                    "x": "ping"
                  },
                  "update": {
                    "$set": {
                      "x": "PONG"
                    }
                  },
                  "collation": {
                    "locale": "en_US",
                    "strength": 2
                  }
                }
              },
              {
                "replaceOne": {
                  "filter": {
                    "x": "ping"
                  },
                  "replacement": {
                    "_id": 6,
                    "x": "ping"
                  },
                  "upsert": true,
                  "collation": {
                    "locale": "en_US",
                    "strength": 3
                  }
                }
              },
              {
                "updateMany": {
                  "filter": {
                    "x": "pong"
                  },
                  "update": {
                    "$set": {
                      "x": "PONG"
                    }
                  },
                  "collation": {
                    "locale": "en_US",
                    "strength": 2
                  }
                }
              }
            ],
            "ordered": true
          },
          "expectResult": {
            "deletedCount": 0,
            "insertedCount": 0,
            "insertedIds": {
              "$$unsetOrMatches": {}
            },
            "matchedCount": 6,
            "modifiedCount": 4,
            "upsertedCount": 1,
            "upsertedIds": {
              "2": 6
            }
          }
        }
      ],
      "outcome": [
        {
          "collectionName": "coll",
          "databaseName": "crud-v1",
          "documents": [
            {
              "_id": 1,
              "x": 11
            },
            {
              "_id": 2,
              "x": "PONG"
            },
            {
              "_id": 3,
              "x": "PONG"
            },
            {
              "_id": 4,
              "x": "PONG"
            },
            {
              "_id": 5,
              "x": "PONG"
            },
            {
              "_id": 6,
              "x": "ping"
            }
          ]
        }
      ]
    }
  ]
}
