{
  "description": "updateOne-hint-serverError",
  "schemaVersion": "1.0",
  "runOnRequirements": [
    {
      "minServerVersion": "3.4.0",
      "maxServerVersion": "4.1.9"
    }
  ],
  "createEntities": [
    {
      "client": {
        "id": "client0",
        "observeEvents": [
          "commandStartedEvent"
        ]
      }
    },
    {
      "database": {
        "id": "database0",
        "client": "client0",
        "databaseName": "crud-v2"
      }
    },
    {
      "collection": {
        "id": "collection0",
        "database": "database0",
        "collectionName": "test_updateone_hint"
      }
    }
  ],
  "initialData": [
    {
      "collectionName": "test_updateone_hint",
      "databaseName": "crud-v2",
      "documents": [
        {
          "_id": 1,
          "x": 11
        },
        {
          "_id": 2,
          "x": 22
        }
      ]
    }
  ],
  "tests": [
    {
      "description": "UpdateOne with hint string unsupported (server-side error)",
      "operations": [
        {
          "object": "collection0",
          "name": "updateOne",
          "arguments": {
            "filter": {
              "_id": {
                "$gt": 1
              }
            },
            "update": {
              "$inc": {
                "x": 1
              }
            },
            "hint": "_id_"
          },
          "expectError": {
            "isError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client0",
          "events": [
            {
              "commandStartedEvent": {
                "command": {
                  "update": "test_updateone_hint",
                  "updates": [
                    {
                      "q": {
                        "_id": {
                          "$gt": 1
                        }
                      },
                      "u": {
                        "$inc": {
                          "x": 1
                        }
                      },
                      "hint": "_id_",
                      "multi": {
                        "$$unsetOrMatches": false
                      },
                      "upsert": {
                        "$$unsetOrMatches": false
                      }
                    }
                  ]
                }
              }
            }
          ]
        }
      ],
      "outcome": [
        {
          "collectionName": "test_updateone_hint",
          "databaseName": "crud-v2",
          "documents": [
            {
              "_id": 1,
              "x": 11
            },
            {
              "_id": 2,
              "x": 22
            }
          ]
        }
      ]
    },
    {
      "description": "UpdateOne with hint document unsupported (server-side error)",
      "operations": [
        {
          "object": "collection0",
          "name": "updateOne",
          "arguments": {
            "filter": {
              "_id": {
                "$gt": 1
              }
            },
            "update": {
              "$inc": {
                "x": 1
              }
            },
            "hint": {
              "_id": 1
            }
          },
          "expectError": {
            "isError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client0",
          "events": [
            {
              "commandStartedEvent": {
                "command": {
                  "update": "test_updateone_hint",
                  "updates": [
                    {
                      "q": {
                        "_id": {
                          "$gt": 1
                        }
                      },
                      "u": {
                        "$inc": {
                          "x": 1
                        }
                      },
                      "hint": {
                        "_id": 1
                      },
                      "multi": {
                        "$$unsetOrMatches": false
                      },
                      "upsert": {
                        "$$unsetOrMatches": false
                      }
                    }
                  ]
                }
              }
            }
          ]
        }
      ],
      "outcome": [
        {
          "collectionName": "test_updateone_hint",
          "databaseName": "crud-v2",
          "documents": [
            {
              "_id": 1,
              "x": 11
            },
            {
              "_id": 2,
              "x": 22
            }
          ]
        }
      ]
    }
  ]
}
