version = 0
name = "Update"
documentation = "Update performs an update operation."

[properties]
enabled = ["write concern"]
retryable = {mode = "once per command", type = "writes"}
batches = "updates"

[command]
name = "update"
parameter = "collection"

[request.updates]
type = "document"
slice = true
constructor = true
variadic = true
required = true
documentation = """
Updates specifies an array of update statements to perform when this operation is executed.
Each update document must have the following structure: {q: <query>, u: <update>, multi: <boolean>, collation: Optional<Document>, arrayFitlers: Optional<Array>}.\
"""

[request.ordered]
type = "boolean"
documentation = """
Ordered sets ordered. If true, when a write fails, the operation will return the error, when
false write failures do not stop execution of the operation.\
"""

[request.bypassDocumentValidation]
type = "boolean"
minWireVersion = 4
documentation = """
BypassDocumentValidation allows the operation to opt-out of document level validation. Valid
for server versions >= 3.2. For servers < 3.2, this setting is ignored.\
"""

[response]
name = "UpdateResult"

[response.field.n]
type = "int32"
documentation = "Number of documents matched."

[response.field.nModified]
type = "int32"
documentation = "Number of documents modified."
