# Copyright (C) 2017 MongoDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
#
global:
cpp_namespace: "mongo::write_ops"
cpp_includes:
- "mongo/db/ops/write_ops_parsers.h"
imports:
- "mongo/db/logical_session_id.idl"
types:
multi_delete_bool:
bson_serialization_type: any
description: "An inverted boolean type used to parse the 'limit' property of the delete
command, which has a mandatory value of either 0 or 1, where 0 means multi
delete and 1 means delete just one."
cpp_type: "bool"
serializer: "::mongo::write_ops::writeMultiDeleteProperty"
deserializer: "::mongo::write_ops::readMultiDeleteProperty"
structs:
WriteCommandBase:
description: "Contains basic information included by all write commands"
strict: false
fields:
bypassDocumentValidation:
description: "Enables the operation to bypass document validation. This lets you
write documents that do not meet the validation requirements."
type: safeBool
default: false
ordered:
description: "If true, then when an write statement fails, the command returns
without executing the remaining statements. If false, then statements
are allowed to be executed in parallel and if a statement fails,
continue with the remaining statements, if any."
type: bool
default: true
stmtId:
description: "A statement number relative to the transaction. If this field
is set, the statement ids of the contained operation will be
implicitly generated based on their offset, starting from the value
given. This field is mutually exclusive with 'stmtIds'."
type: int
optional: true
stmtIds:
description: "An array of statement numbers relative to the transaction. If this
field is set, its size must be exactly the same as the number of
entries in the corresponding insert/update/delete request. If it is
not set, the statement ids of the contained operation will be
implicitly generated based on their offset, starting from 'stmtId' or
0 if 'stmtId' is not specified. This field is mutually exclusive
with 'stmtId'."
type: array
optional: true
UpdateOpEntry:
description: "Parser for the entries in the 'updates' array of an update command."
strict: true
fields:
q:
description: "The query that matches documents to update. Uses the same query
selectors as used in the 'find' operation."
type: object
u:
description: "Set of modifications to apply."
type: object
arrayFilters:
description: "Specifies which array elements an update modifier should apply to."
type: array