# Copyright (C) 2018-present MongoDB, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the Server Side Public License, version 1, # as published by MongoDB, Inc. # # 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 # Server Side Public License for more details. # # You should have received a copy of the Server Side Public License # along with this program. If not, see # . # # As a special exception, the copyright holders give permission to link the # code of portions of this program with the OpenSSL library under certain # conditions as described in each individual source file and distribute # linked combinations including the program with the OpenSSL library. You # must comply with the Server Side Public License in all respects for # all of the code used other than as permitted herein. If you modify file(s) # with this exception, you may extend this exception to your version of the # file(s), but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. If you delete this # exception statement from all source files in the program, then also delete # it in the license file. # # IDL Basic Types global: cpp_namespace: "mongo" cpp_includes: - "mongo/db/namespace_string.h" - "mongo/idl/basic_types.h" - "mongo/util/uuid.h" types: string: bson_serialization_type: string description: "A BSON UTF-8 string" cpp_type: "std::string" deserializer: "mongo::BSONElement::str" int: bson_serialization_type: int description: "A BSON 32-bit integer" cpp_type: "std::int32_t" deserializer: "mongo::BSONElement::_numberInt" safeInt: bson_serialization_type: - long - int - decimal - double description: "Accepts any numerical type within integer range" cpp_type: "std::int32_t" deserializer: "mongo::BSONElement::safeNumberInt" safeInt64: bson_serialization_type: - long - int - decimal - double description: "Accepts any numerical type within int64 range" cpp_type: std::int64_t deserializer: "mongo::BSONElement::safeNumberLong" exactInt64: bson_serialization_type: - long - int - decimal - double description: "Accepts any number that can be exactly converted to an int64" cpp_type: std::int64_t deserializer: "mongo::BSONElement::exactNumberLong" safeDouble: bson_serialization_type: - long - int - decimal - double description: "Accepts any numerical type within double range" cpp_type: double deserializer: "mongo::BSONElement::safeNumberDouble" long: bson_serialization_type: long description: "A BSON 64-bit integer" cpp_type: "std::int64_t" deserializer: "mongo::BSONElement::_numberLong" double: bson_serialization_type: double description: "A BSON 64-bit floating point number" cpp_type: "double" deserializer: "mongo::BSONElement::_numberDouble" decimal: bson_serialization_type: double description: "A BSON 128-bit floating point decimal number" cpp_type: "mongo::Decimal128" deserializer: "mongo::BSONElement::_numberDecimal" bool: bson_serialization_type: bool description: "A BSON bool" cpp_type: "bool" deserializer: "mongo::BSONElement::boolean" safeBool: bson_serialization_type: - bool - long - int - decimal - double description: "Accepts any numerical type (including bool) which can be interpreted as a true/false value" cpp_type: bool deserializer: "mongo::BSONElement::trueValue" optionalBool: bson_serialization_type: any description: "An optional bool type that does not serialize unless explicitly set. Can be used in place of boost::optional to provide more intuitive semantics, since the standard optional will coerce to true if populated regardless of its internal value." cpp_type: "mongo::OptionalBool" default: "mongo::OptionalBool()" deserializer: "mongo::OptionalBool::parseFromBSON" serializer: "mongo::OptionalBool::serializeToBSON" bindata_generic: bson_serialization_type: bindata bindata_subtype: generic description: "A BSON bindata of generic sub type" cpp_type: "std::vector" deserializer: "mongo::BSONElement::_binDataVector" bindata_function: bson_serialization_type: bindata bindata_subtype: function description: "A BSON bindata of function sub type" cpp_type: "std::vector" deserializer: "mongo::BSONElement::_binDataVector" bindata_uuid: bson_serialization_type: bindata bindata_subtype: uuid description: "A BSON bindata of uuid sub type" cpp_type: "std::array" deserializer: "mongo::BSONElement::uuid" uuid: bson_serialization_type: bindata bindata_subtype: uuid description: "A UUID" cpp_type: "mongo::UUID" deserializer: "UUID" serializer: "mongo::UUID::toCDR" bindata_md5: bson_serialization_type: bindata bindata_subtype: md5 description: "A BSON bindata of uuid sub type" cpp_type: "std::array" deserializer: "mongo::BSONElement::md5" objectid: bson_serialization_type: objectid description: "A BSON ObjectID" cpp_type: "mongo::OID" deserializer: "mongo::BSONElement::OID" object: bson_serialization_type: object description: "An unowned BSONObj without custom deserialization or serialization" cpp_type: "mongo::BSONObj" object_owned: bson_serialization_type: object description: "An owned BSONObj" cpp_type: "mongo::BSONObj" deserializer: "BSONObj::getOwned" date: bson_serialization_type: date description: "A BSON UTC DateTime" cpp_type: "mongo::Date_t" deserializer: "mongo::BSONElement::date" timestamp: bson_serialization_type: timestamp description: "A BSON TimeStamp" cpp_type: "mongo::Timestamp" deserializer: "mongo::BSONElement::timestamp" namespacestring: bson_serialization_type: string description: "A MongoDB NamespaceString" cpp_type: "mongo::NamespaceString" serializer: mongo::NamespaceString::toString deserializer: mongo::NamespaceString fcv_string: bson_serialization_type: string description: >- Ensures that the version strings in featureCompatibilityVersion documents serialize/deserialize to a fixed set of string values cpp_type: "ServerGlobalParams::FeatureCompatibility::Version" serializer: "::mongo::FeatureCompatibilityVersionParser::serializeVersion" deserializer: "mongo::FeatureCompatibilityVersionParser::parseVersion" IDLAnyType: bson_serialization_type: any description: "Holds a BSONElement of any type." cpp_type: "mongo::IDLAnyType" serializer: mongo::IDLAnyType::serializeToBSON deserializer: mongo::IDLAnyType::parseFromBSON IDLAnyTypeOwned: bson_serialization_type: any description: "Holds a BSONElement of any type. Does not require the backing BSON to stay alive." cpp_type: "mongo::IDLAnyTypeOwned" serializer: mongo::IDLAnyTypeOwned::serializeToBSON deserializer: mongo::IDLAnyTypeOwned::parseFromBSON writeConcernW: bson_serialization_type: - string - int - decimal - double - long description: >- A string or integer representing the 'w' option in a document specifying write concern. See https://docs.mongodb.com/manual/reference/write-concern/" cpp_type: "mongo::WriteConcernW" default: "mongo::WriteConcernW()" serializer: "mongo::WriteConcernW::serializeWriteConcernW" deserializer: "mongo::WriteConcernW::deserializeWriteConcernW" enums: ReadWriteConcernProvenanceSource: description: "Provenance sources" type: string values: clientSupplied: "clientSupplied" implicitDefault: "implicitDefault" customDefault: "customDefault" getLastErrorDefaults: "getLastErrorDefaults" internalWriteDefault: "internalWriteDefault" CollationCaseFirst: description: Sort order of case differences. type: string values: kUpper: upper kLower: lower kOff: off CollationStrength: description: Controls the set of characteristics used to compare strings. type: int values: kPrimary: 1 kSecondary: 2 kTertiary: 3 kQuaternary: 4 kIdentical: 5 CollationAlternate: description: Whether collation should consider whitespace and punctuation as base characters for purposes of comparison. type: string values: kNonIgnorable: non-ignorable kShifted: shifted CollationMaxVariable: description: Up to which characters are considered ignorable when alternate is "shifted". type: string values: kPunct: punct kSpace: space structs: OkReply: description: "Shared by commands that reply with just {ok: 1} and no additional information" strict: true ErrorReply: description: "Error Reply structure shared by all commands" strict: false fields: ok: type: safeDouble validator: { gte: 0.0, lte: 0.0 } code: int codeName: string errmsg: string errorLabels: type: array optional: true SimpleCursorOptions: description: "Parser for cursor options, for commands with minimal cursor support" strict: true fields: batchSize: type: safeInt64 optional: true validator: { gte: 0 } WriteConcernIdl: description: "WriteConcern object parser" strict: true fields: w: type: writeConcernW cpp_name: writeConcernW j: type: safeBool optional: true wtimeout: type: safeInt64 default: 0 fsync: type: safeBool optional: true # Fields with names wElectionId, wOpTime, and getLastError are accepted in the WriteConcern document for # backwards-compatibility reasons, but their values are entirely ignored. wElectionId: type: any ignore: true wOpTime: type: any ignore: true getLastError: type: any ignore: true provenance: description: "The source for this provenance" cpp_name: source type: ReadWriteConcernProvenanceSource optional: true Collation: description: "Specifies the default collation for the collection or the view." strict: true generate_comparison_operators: true fields: locale: type: string # Turns case sensitivity on at strength 1 or 2. caseLevel: type: bool default: false caseFirst: type: CollationCaseFirst default: kOff # For backwards-compatibility, we must accept longs, ints, and doubles, so we cannot # use the int-typed CollationStrength enum directly. strength: type: safeInt default: static_cast(CollationStrength::kTertiary) validator: { gte: 0, lte: 5 } # Order numbers based on numerical order and not lexicographic order. numericOrdering: type: bool default: false alternate: type: CollationAlternate default: kNonIgnorable maxVariable: type: CollationMaxVariable default: kPunct # Any language that uses multiple combining characters such as Arabic, ancient Greek, # Hebrew, Hindi, Thai or Vietnamese either requires Normalization Checking to be on, or # the text to go through a normalization process before collation. normalization: type: bool default: false # Causes accent differences to be considered in reverse order, as it is done in the # French language. Note: the optionalBool parser rejects null/undefined inputs, which # preserves an invariant in updateCollationSpecFromICUCollator. backwards: type: optionalBool # Indicates the version of the collator. It is used to ensure that we do not mix # versions by, for example, constructing an index with one version of ICU and then # attempting to use this index with a server that is built against a newer ICU version. version: type: string optional: true unstable: true