Error codes - Amazon DocumentDB
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

Error codes

When a command fails, you receive an error from Amazon DocumentDB (with MongoDB compatibility) that contains a numeric error code and a descriptive message (errmsg). Use the following table to identify the error codes that Amazon DocumentDB 8.0 might return to your client application. Where an error code corresponds to a single condition, the description matches the message text returned by the server. Codes that cover multiple conditions have a general description.

Important

Error codes might change between major versions of Amazon DocumentDB. We recommend that you don't build application logic that depends on a specific numeric error code remaining stable across versions.

Error code Description
1Item not found
2A command argument, option, or field value is invalid or unsupported.
4A required field is missing or a configuration value is not correctly formatted.
5A view definition references itself, creating a cycle, or a filesystem error occurred.
9A command, field, hint, or resume token could not be parsed or has an invalid format.
10The target collection was not found or no collection was specified.
11A referenced user could not be found, or the target collection already exists.
13You are not authorized to run this command, or your authentication is invalid.
14A field or value has the wrong data type.
15A value overflowed its allowed range during evaluation.
16The write batch is empty, malformed, or exceeds the allowed operation count.
17Not all objects have the same type
18Authentication failed because the credentials are invalid or the user does not exist.
19Data processing primitive operation not found or primitive type not found
20The requested operation is not permitted in this context.
26The target namespace or collection does not exist.
27The requested index does not exist or no suitable index is available.
37A pipeline or aggregation stage argument is missing, empty, or invalid.
38Database name not found
39The operation was canceled because it exceeded maxTimeMS, ran too long, or exceeded available memory.
40An update conflicts with another field, or writes are throttled or disabled by garbage collection.
41JavaScript error
43The specified cursor no longer exists or has expired.
44Array index out of bounds
48A collection, view, or namespace with that name already exists.
51Illegal update operator
52A field name uses a reserved '$' prefix that is not valid for storage.
53The _id field has an invalid or unsupported type, such as an array or regex.
54cannot infer query fields to set
55Transaction already committed
56A field name in the request is empty, which is not allowed.
57Transaction invalidated by other transaction
58Field value too long
59The requested command is unknown or not supported.
61Invalid collection
62Cannot make changes to collection
65batch op errors occurred
66An update attempted to modify the immutable _id field.
67The index could not be created because of an invalid or unsupported specification.
68An index with conflicting properties already exists.
70field used with $snippet is not configured as snippet column
71Index already exists with different options
72One or more options specified for the command or index are invalid.
73The namespace, database, or collection name is invalid or not allowed for this operation.
74Collection does not have a text index defined.
75A text index is defined for this collection, but not for this field.
77Can't use snapshot with sort
78Document not found
80The query exceeds the maximum allowed size.
82Time frame has invalid formatting. Valid format: '1 m' or '3 y' '<number> h/d/w/s/m/y'
85An index with that name already exists but with different options.
86The requested index conflicts with an existing index that has the same name.
87$sort key ordering must be 1 (for ascending) or -1 (for descending)
92Not enough space for operation
93User already exists
94The target collection, cluster, or resource privilege is invalid or unavailable.
95Database does not exist
96'writeConcern' parameter is invalid
97Password cannot be empty
99Undefined role or privilege
102Cannot add a role that is already built-in
103A valid role could not be extracted from the collection.
105The user is invalid or the authorization library could not be initialized.
107Database cannot be granted roles from other database
111_id must be exactly specified when providing update document
112Write Conflict
113The specified role does not exist.
114Role already exists
115anyResource should be true when specified
116resources should have either db and collection set, cluster set or anyResource set
117The operation conflicts with another in-progress operation, such as an active transaction.
120'showPrivileges' cannot be specified as we are showing all users
121Document failed validation
122Update error
124Error processing schema id
125The command failed, often because of an ambiguous reference or missing session.
126Database already exists
127Database name already exists in a difference case name
128Too many fields
129Waiting for drop database
130Bad parameter value
136The cursor position was lost, or a required change stream feature is not enabled.
139JS Interpreter failure
145Alias not defined in query
147not master
148Insufficient resources to run query
149Alias already defined in query
154An argument has an illegal value or an incorrect (non-numeric) type.
155NULL value encountered
156UNDEFINED value encountered
157NAN value encountered
158Collection already in use for another purpose
159A duration value overflowed or a network operation failed.
161The requested collation version is invalid or unavailable.
163A field or name is not valid for storage.
164A query operator was nested in a way that is not allowed.
165A view exceeds the maximum nesting depth of 20 or references itself in a cycle.
166The operation is not supported on a view, or too many positional elements were used.
167The requested operation or stage is not supported on a view.
168An expression or pipeline operator is unrecognized or has an invalid argument.
169BadValue $maxTimeMS has non-integral value
170BadValue $maxTimeMS is out of range
171An index cannot be built over multiple array fields.
173Skip value must be positive
174Expected log verbosity to be a number
181The key pattern matches multiple indexes; specify the index by name instead.
197The index specification contains an invalid or unsupported field.
207uuid must be a 16-byte binary field with UUID (4) subtype
224This query feature is not allowed in the current context.
225A newer transaction has started on the session, so this older one cannot proceed.
241A value could not be converted to the requested type in $convert.
250Invalid view
251The specified transaction number does not match any active transaction.
252Recursion limit reached
253Could not insert entry into view
254Could not delete entry from view
256Document filtered by $having clause
257The total size of all operations in the transaction exceeds the allowed limit.
263This operation cannot be run inside a multi-document transaction.
291unable to find index for $geoNear query
300Authentication failed because of a SASL handshake or session error.
301An authentication mechanism or requested operation is not supported.
302Authentication needs additional data to complete the SASL exchange.
303The requested stage, option, or role configuration is not supported.
304The requested aggregation stage is not supported.
305The aggregation projection operator is not supported.
306The specified aggregation group accumulator operator is not supported.
502Column already exists
505Insertion not allowed here
601Coordinates are out of bounds
602Index error
700Changes to this parameter is not allowed in live mode
701Invalid value for this parameter
703Illegal state transition for this parameter
999Bad transaction ID
4570$lookup parameter expecting string value
4572$lookup is missing required fields
10065A parameter that must be an object (such as vars or $rand) was given a non-object value.
10107not master
11000A duplicate key violates a unique index constraint.
11601The operation was interrupted.
11603Client request corrupted or illegal syntax
13103too many compound keys
13297A database with the same name already exists but differs only in letter case.
13388Unrecognized pipeline stage name: $collStats
13435not master and slaveOk=false
14031Not enough disk space
15888must pass name of collection to create
15947a group's fields must be specified in an object
15950Group aggregate field name cannot be an operator
15952unknown $group operator
15955Syntax error in group aggregation operator: the _id field must be specified
15956The $skip argument is negative; it must be a non-negative number.
15957the limit must be specified as a number
15958The $limit value must be a positive number.
15959the match filter must be an expression in an object
15969Syntax error: the value of the $project operator must be a document.
15972Argument to $skip must be a number
15973the $sort key specification must be an object
15974$sort key ordering must be specified using a number
15975$sort key ordering must be 1 (for ascending) or -1 (for descending)
15976$sort stage must have at least one sort key
15981query field is not a string
15983An object representing an expression must have exactly one field.
15992disallowed field type NULL in object expression
15998Field path names may not be empty strings.
16006A value could not be converted to a Date because it is not a valid date type.
16007A value cannot be converted to a string because a string was expected.
16020An expression operator was called with the wrong number of arguments.
16034$substrBytes starting index must be a numeric type.
16035$substrBytes length argument must be a numeric type.
16395$where is not allowed inside of a $match aggregation expression
16400can't add an expression for a field because there is already an expression for that field or one of its sub-fields.
16401can't add an expression for a subfield because there is already an expression that applies to the whole field
16404$ expressions are not allowed in this context
16406Cannot exclude fields other than _id
16410A $project field name or path illegally starts with or contains '$'.
16411Field names cannot contain null character(s)
16419field path must not contain embedded null characters
16424$near is not allowed inside of a $match aggregation expression
16426$nearSphere/$near is not allowed inside of a $match aggregation expression
16435Pipeline component must contain one element
16493Tried to create string longer than 16MB
16554$add only supports numeric or date types.
16605$geoNear requires a valid 'near' field and correctly typed geoNear options.
16606$geoNear requires a 'distanceField' option as a String
16607$geoNear requires the given option to be specified as a string.
16608Divide by zero
16610$mod was given a divisor of zero.
16611$mod only supports numeric types for both operands.
16612only one date allowed in an $add expression
16613The operation attempted to subtract a non-numeric, non-date value from a date.
16702$concat only supports string arguments.
16730textIndexVersion is out of range
16755can't index geometry with strict winding order
16800can't have 2 geo fields
168012d has to be first in index
16804location object expected, location array not in correct format
16810$mod requires an array of exactly two values as its parameter.
16837An update path cannot modify the same field more than once.
16868Invalid variable name
16869Invalid variable name
16870Invalid variable name
16872A field path is empty or '$' alone is used as a field path in $project.
16873Fieldpath does not start with $
16874$let only supports an object as its argument
16875$let was given an unrecognized parameter.
16876Missing 'vars' parameter to $let
16877Missing 'in' parameter to $let
16878$map only supports an object as its argument
16879$map is given an unrecognized parameter.
16880$map is missing its required 'input' parameter.
16881Missing required field
16882Missing 'in' parameter to $map
16883The input to $map must be an array.
16898$minDistance must be non-negative
16899$maxDistance must be a number
16900$maxDistance must be non-negative
16945Exceeded memory limit for $group or $lookup. Pass allowDiskUse:true to opt in.
16949Invalid aggregation option; allowDiskUse must be a boolean value.
16990$out requires a string or object argument naming the output target.
16996insert for $out failed
16997$out failed because the target collection's indexes changed during processing.
17040$allElementsTrue's argument must be an array.
17041$anyElementTrue's argument must be an array.
17042Both operands of $setIsSubset must be arrays.
17043All operands of $setUnion must be arrays.
17044An operand of $setEquals is not an array.
17045$setEquals requires at least two arguments.
17046Both operands of $setIsSubset must be arrays.
17047All operands of $setIntersection must be arrays.
17048Both operands of $setDifference must be arrays.
17049Both operands of $setDifference must be arrays.
17053$redact's expression should not return anything aside from the variables $$KEEP, $$DESCEND, and $$PRUNE
17080Missing 'if' parameter to cond
17081Missing 'then' parameter to cond
17082Missing 'else' parameter to cond
17083Unrecognized parameter to $cond
17124The argument to $size must be an array.
17275Can't redefine ROOT
17276Variable not found
17280The index key value is too large to index.
17287$merge cannot modify the same target row more than once.
17293text index option 'textIndexVersion' must be a number
17302This argument value must be greater than or equal to zero.
17304$geoNear requires a valid 'near' point and geo query arguments.
17308$meta is given an unsupported argument.
17310Both operands of $setIsSubset must be arrays.
17313$match with $text is only allowed as the first pipeline stage.
17320createCollection cannot run on a namespace containing a reserved name.
17385Cannot $out to special collection
17390$group does not support inclusion-style expressions
17419The resulting document after update exceeds the maximum allowed size.
17420Document to upsert is larger than 16777216
18533Format field must be a string
18534Unrecognized field to $dateToString
18535Date format string is invalid because of a trailing percent sign.
18536Invalid $dateToString time format
18537$dateToString cannot format a date component outside the range 0-9999.
18627Missing 'format' parameter to $dateToString
18628Missing 'date' parameter to $dateToString
18629incorrect argument type
25278$geoNear requires a 'distanceField' argument
26823An operation ID cannot be represented within the available bits.
28539The first argument to the distinct command must be a string
28646$Filter expects an object as a parameter
28647Unexpected field to $filter
28648$Filter requires an 'input' field
28649$Filter requires an 'as' field
28650$Filter requires a 'cond' field
28651Array input required
28656$substrBytes: Invalid range, starting index is a UTF-8 continuation byte.
28657$substrBytes: Invalid range, ending index is in the middle of a UTF-8 character.
28664$concatArrays only supports array inputs.
28667An expression such as $slice, $range, or $indexOfArray got the wrong number of arguments.
28680$abs is applied to a value, like the minimum long, that cannot be negated.
28689An operator argument must be an array but a different type was given.
28690Second argument to arrayElemAt must be numeric
28691Second argument to arrayElemAt must be represented by a 32 bit integer
28714$sqrt's argument must be greater than or equal to 0
28724The first argument to $slice must be an array.
28725The second argument to $slice must be a numeric value.
28726The second argument to $slice must fit in a 32-bit integer.
28727The third argument to $slice must be a number.
28728The third argument to $slice must be a 32-bit integer.
28729$slice's third argument must be a positive 32-bit integer.
28745the $sample stage specification must be an object
28746size argument to $sample must be a number
28747size argument to $sample must not be negative
28748$sample received an unrecognized option.
28749$sample stage must specify a size
28756$log's argument must be numeric.
28757$log requires its base argument to be a numeric value.
28758The argument to $log must be a positive number.
28759$log's base must be a positive number not equal to 1.
28761$log10's argument must be a positive number.
28762$pow's base must be a numeric value.
28763$pow's exponent must be numeric.
28764$pow cannot take a base of 0 and a negative exponent
28765$ceil, $exp, $floor, $ln, or $log10 receives a non-numeric type.
28766$ln requires a positive number argument.
28812Fieldpath is empty
28818Fieldpath does not start with a '$'
31022This operator requires an 'input' parameter to be specified.
31023This operator requires a 'regex' parameter.
31024The operator is given an unknown argument.
31032A field name cannot contain an embedded null byte.
31034A value falls outside the allowed range of [-32768, 32767].
31095'isoWeekYear' must evaluate to an integer between 1 and 9999.
31138The $meta value used for sorting is not a valid metadata keyword.
31170An empty object was expected but a non-empty value was provided.
31249A projection path collides with another field in the projection.
31254An inclusion cannot be specified within an exclusion projection.
31393$bsonSize requires a document as input.
31394A positional projection operator cannot appear in the middle of a field path.
34413An invalid operator was used in a geo near query.
34435The argument to $reverseArray must be an array.
34443$range requires a numeric starting value.
34444$range requires a starting value representable as a 32-bit integer.
34445$range requires its ending value to be numeric.
34446$range ending value must fit in a 32-bit integer.
34447$range requires a numeric step value.
34448$range requires a step value representable as a 32-bit integer.
34449$range requires a non-zero step value
34450$substrCP's starting index must be a numeric type.
34451The $substrCP starting index cannot be represented as a 32-bit integer.
34452The length argument to $substrCP is not a numeric type.
34453$substrCP length cannot be represented as a 32-bit integer.
34454$substrCP: length must be a nonnegative integer.
34455$substrCP: the starting index must be nonnegative integer.
34460$zip only supports an object as its argument.
34461$zip inputs must be an array of expressions.
34462The 'defaults' option must be an array of expressions.
34463$zip's useLongestLength option must be a boolean.
34464$zip was given an unknown argument.
34465$zip requires at least one input array
34466cannot specify defaults unless useLongestLength is true
34467defaults and inputs must have the same length
34468$zip receives a non-array expression in its input.
34471$strLenCP requires a string argument.
34473$strLenBytes requires a string argument.
40060$switch requires an object as its argument.
40061$switch requires 'branches' to be an array.
40062$switch requires each branch to be an object.
40063$switch is given an unknown argument within a branch.
40064$switch requires each branch have a 'case' expression.
40065$switch requires each branch have a 'then' expression.
40066$switch could not find a matching branch for an input, and no default was specified.
40067The $switch expression contains an unknown argument.
40068$switch requires at least one branch
40075$reduce requires object
40076Unknown argument to $reduce
40077$reduce requires 'input'
40078$reduce requires 'initialValue'
40079$reduce requires 'in'
40080The input to $reduce must be an array.
40081The operator requires an array as its second argument.
40085$split requires its first argument to evaluate to a string.
40086$split's second argument must evaluate to a string.
40087$split requires a non-empty separator
40090$indexOfArray requires an array as a first argument
40091The first argument to $indexOfBytes is not a string.
40092$indexOfBytes requires a string as its second argument.
40093$indexOfCP requires a string as its first argument.
40094$indexOfCP requires a string as its second argument.
40096$indexOfArray requires integral starting and ending index values.
40097$indexOfArray requires nonnegative numeric start and end indexes.
40148the sortByCount field must be defined as a $-prefixed path or an expression inside an object
40149the sortByCount field must be specified as a string or as an object
40156the count field must be a non-empty string
40157the count field must be a non-empty string
40158the count field cannot be a $-prefixed path
40159the count field cannot contain a null byte
40160the count field cannot contain '.'
40169the $facet specification must be a non-empty object
40170arguments to $facet must be arrays
40171elements of arrays in $facet spec must be non-empty objects
40172sub-pipeline in $facet stage cannot be empty
40176Conflicting fieldnames given
40177$project and $addFields require at least one output field.
40178Cannot exclude fields except '_id' in an inclusion projection
40179Cannot include fields or reset fields or add computed fields in an exclusion projection
40180$project does not allow an empty object as a field value.
40181Invalid $project :: caused by :: an expression specification must contain exactly one field.
40183A dotted field name cannot be used inside a sub-object.
40192The $bucket 'boundaries' field must have at least 2 values
40193All values in the the 'boundaries' option to $bucket must have the same type
40194The 'boundaries' option to $bucket must be sorted, but elements are not in ascending order
40195The $bucket 'default' field must be a constant expression
40196The $bucket 'output' field must be an object
40197Unrecognized option to $bucket
40198$bucket requires 'groupBy' and 'boundaries' to be specified
40199The $bucket 'default' field must be less than the lowest boundary or greater than or equal to the highest boundary.
40200The $bucket 'boundaries' field must be an array
40201Argument to $bucket stage must be an object
40202The $bucket 'groupBy' field must be defined as a $-prefixed path or an expression
40203The field must be an accumulator object
40204The field name cannot contain '.'
40205The field name cannot be an operator name
40206The accumulator is a unary operator
40218query requires text score metadata, but it is not available
40228$replaceRoot 'newRoot' expression must evaluate to an object.
40229$replaceRoot requires an object as its specification.
40230$replaceRoot only accepts the 'newRoot' option.
40234The $group field must be an accumulator object.
40235A field name cannot contain a '.' character.
40236Field names may not start with '$'
40237This accumulator is a unary operator and takes a single argument.
40239The $bucketAuto 'groupBy' field must be defined as a $-prefixed path or an expression object
40240The argument to $bucketAuto must be an object
40241The $bucketAuto 'buckets' field must be a numeric value
40242The $bucketAuto 'buckets' field must be representable as a 32-bit integer
40243The $bucketAuto 'buckets' field must be greater than 0
40244The $bucketAuto 'output' field must be an object
40245Unrecognized option to $bucketAuto
40246$bucketAuto requires 'groupBy' and 'buckets' to be specified
40257Unknown rounding granularity
40258$bucketAuto can specify a 'granularity' with numeric boundaries only
40260$bucketAuto can specify a 'granularity' with non-negative numbers only, but found a negative number
40261The $bucketAuto 'granularity' field must be a string
40272The $addFields stage specification must be an object.
40319the $lookup stage specification must be an object
40320missing 'from' option to $lookup stage specification
40321'from' option to $lookup must be a string
40322invalid $lookup namespace
40323A pipeline stage specification object must contain exactly one field.
40324The pipeline contains an unrecognized stage name.
40331This aggregation stage is not allowed inside a $facet pipeline.
40352$project field paths cannot be empty strings.
40353A field path must not end with a '.'.
40386$arrayToObject requires an array input.
40390$objectToArray requires a document as input.
40391$arrayToObject requires a consistent input format. Elements mustall be arrays or all be objects. Object was detected, now found: array
40392$arrayToObject requires objects with exactly the keys 'k' and 'v'.
40393$arrayToObject requires an object with keys 'k' and 'v'. Missing either or both keys
40394$arrayToObject requires objects with string 'k' keys and 'v' values.
40395$arrayToObject requires key-value pairs whose keys are strings.
40396$arrayToObject requires a consistent input format. Elements mustall be arrays or all be objects. Array was detected, now found: object
40397$arrayToObject requires an array of two-element arrays.
40398$arrayToObject is given an input of an unrecognized type or format.
40400$mergeObjects requires all inputs to be objects.
40414A required command field is missing or failed validation.
40415The command contains an unrecognized field.
40422A BSON array field name has an invalid value.
40485An unrecognized time zone identifier was supplied.
40489$dateFromParts does not allow mixing regular calendar fields with ISO week date fields
40515A $dateFromParts argument does not evaluate to an integer number.
40516$dateFromParts requires either 'year' or 'isoWeekYear' to be present
40517The 'timezone' option must evaluate to a string for date operators.
40518$dateFromParts or $dateToParts got an unrecognized or wrongly typed parameter.
40519$dateFromParts only supports an object as its argument.
40520$dateToParts was given an unrecognized parameter.
40522$dateToParts requires an object argument with a 'date' parameter.
40523$dateFromParts 'year' must be an integer in the range 1 to 9999.
40525$dateFromParts ISO week/day values are out of range or missing required fields.
40533The timezone argument must be a string.
40535An unrecognized option was supplied to the stage or expression.
40536The expression accepts exactly one argument when given an array.
40539The required 'date' argument to a date operator is missing.
40540$dateFromString only supports an object as an argument
40541$dateFromString received an unrecognized argument.
40542Missing 'dateString' parameter to $dateFromString
40543$dateFromString requires that 'dateString' be a string.
40545The date/time string is incomplete, with required elements missing.
40551you cannot pass in a date/time string with time zone information together with a timezone argument
40553$dateFromString cannot parse the given date string.
40554you cannot pass in a date/time string with GMT offset together with a timezone argument
40575$changeStream 'fullDocument' must be "default" or "updateLookup".
40600$out cannot be used within a $facet stage.
40601$out and $merge can only be the final stage in the pipeline.
40602A stage like $changeStream or $geoNear is not the first in the pipeline.
40603$geoNear was not the first stage in the pipeline after optimization. Is optimization disabled or inhibited?
40647The change stream resume token has a missing or wrong-typed _data field.
40674Only one type of resume option is allowed, but multiple were found.
50001autoIndexId:false is not allowed for the specified collection.
50694This operator was given an unknown argument.
50695This operator requires an 'input' field.
50696The operator only supports an object as its argument.
50699This expression operator requires its input to be a string.
50700The 'chars' argument must be a string.
50736getMore cannot run in a session on a cursor not created in a session.
50737Running getMore on a session-created cursor requires an lsid to be supplied.
50752The $substrBytes starting index is negative.
50808$changeStream stage expects a document as its argument.
51024The collation 'strength' value must be 5 or less.
51047This operator or stage is not allowed within a $lookup sub-pipeline.
51075Cannot set options in both $regex and $options
51076Insufficient memory to build the vector index for the specified number of lists.
51078Could not find index name.
51079Latency Stats are not supported
51091A regular expression is invalid or badly formed.
51103The operator expects an object of named arguments but received another type.
51104The operator requires its 'input' argument to be a string.
51105An operator's 'regex' argument is not a string or regex type.
51106An operator requires its 'options' parameter to be a string.
51107$regex options cannot be specified in both the 'regex' and 'options' fields.
51108Regular expression options contain an invalid flag or embedded null byte.
51109A regular expression cannot contain an embedded null byte.
51110Regular expression options cannot contain an embedded null byte.
51111The regular expression supplied to this operator is invalid.
51151The size of buffer to store output exceeded the data type limit
51156A regular expression failed to execute in $regex during evaluation.
51270An empty sub-projection object is not a valid projection value.
51272Syntax error: $projection requires at least one output field.
51744The operator requires 'replacement' to be a string.
51745The operator requires its 'find' argument to be a string.
51746An operator's 'input' argument is not a string.
51747An operator requires a 'replacement' parameter.
51748This operator requires a 'find' parameter.
51749This operator requires an 'input' parameter.
51750An aggregation operator received an unknown argument.
100003Internal system error while processing the optimized query path
100005A configured limit, such as collections, custom roles, or privileges, has been exceeded.
100006The maximum number of allowed users has been exceeded.
3040501$rand does not currently accept arguments
3041701$getField received an unknown argument in $project.
3041702Invalid $project :: caused by :: $getField requires 'field' to be specified
3041703Invalid $project :: caused by :: $getField requires 'input' to be specified
3041704$getField requires the 'field' argument to evaluate to a string.
4161100$setField and $unsetField only support an object as their argument.
4161101$setField or $unsetField was given an unknown argument.
4161102$setField and $unsetField require a 'field' to be specified.
4161103Invalid $project :: caused by :: $setField requires 'value' to be specified
4161105$setField or $unsetField requires 'input' to evaluate to an object.
4161106$setField and $unsetField require 'field' to evaluate to a constant.
4161107$setField or $unsetField requires 'field' to evaluate to a string.
4161108$project disallows a field path reference here; use {$literal: ...} instead.
4161109$setField and $unsetField require an 'input' field to be specified.
4662500The command contains an unrecognized field.
4862100The fully qualified namespace exceeds the maximum allowed length.
5166301$dateDiff only supports an object as its argument
5166302$dateDiff was given an unrecognized argument.
5166303Missing 'startDate' parameter to $dateDiff
5166304Missing 'endDate' parameter to $dateDiff
5166305Missing 'unit' parameter to $dateDiff
5166307A $dateDiff argument is not a date.
5166308$dateDiff overflowed while computing the date difference.
5166400$dateAdd and $dateSubtract require their argument to be an object.
5166401$dateAdd or $dateSubtract got an unrecognized argument.
5166402$dateAdd or $dateSubtract require startDate, unit, and amount to be present.
5166403$dateAdd requires startDate to be convertible to a date
5166404$dateAdd expects string defining the time unit
5166405$dateAdd expects integer amount of time units
5166406dateAdd overflowed
5166503An unknown time unit value was provided.
5439002$dateTrunc overflowed while computing the truncated date.
5439006dateTrunc unsupported binSize value
5439007$dateTrunc only supports an object as its argument
5439008Unrecognized $dateTrunc argument; expected date, unit, binSize, timezone, startOfWeek.
5439009Missing 'date' parameter to $dateTrunc
5439010Missing 'unit' parameter to $dateTrunc
5439012$dateTrunc requires 'date' to be a date.
5439013$dateDiff and $dateTrunc require 'unit' to be a string.
5439014$dateDiff and $dateTrunc 'unit' value is not a recognized time unit.
5439015$dateDiff or $dateTrunc require 'startOfWeek' to be a string.
5439016$dateDiff or $dateTrunc 'startOfWeek' value is not a valid day of the week.
5439017$dateTrunc requires 'binSize' to be a 64-bit integer.
5439018$dateTrunc requires 'binSize' to be greater than 0.
5447000The $collStats stage must be a nested object.
5626500$geoNear, $near, and $nearSphere are not allowed in this context, as these operators require sorting geospatial data. If you do not need sort, consider using $geoWithin instead.
5654600$project does not allow a field path reference in this context.
5654601Invalid $project :: caused by :: $getField requires 'field' to evaluate to a constant, but got a non-constant argument
5654602$getField requires 'field' to evaluate to a string.
5733415can't $mod by zero
5860400$geoNear requires a 'near' argument
5887502All operands of $setEquals must be arrays.
5911200PlanExecutor error during aggregation :: caused by :: $mergeObjects only supports objects
5976500$dateAdd was given an invalid 'amount' parameter value.
6045000$dateSubtract was given an invalid 'amount' parameter value.
7158303$switch found no matching branch for the input and no default was specified.