Supported MongoDB APIs, Operations, and Data Types
Amazon DocumentDB (with MongoDB compatibility) is a fast, scalable, highly-available, and fully managed document database service that supports MongoDB workloads. Amazon DocumentDB is compatible with the MongoDB 3.6 API. This section lists the supported functionality. For functional differences between Amazon DocumentDB and MongoDB, please see Functional Differences: Amazon DocumentDB and MongoDB.
MongoDB commands and operators that are internal-only or not applicable to a fully-managed service are not supported and are not included in the list of supported functionality. All capabilities marked as Yes have been available in the service since launch. New capabilities that are added will be marked with Yes and the date it was launched.
If there is a feature that isn't supported that you'd like us to build,
let us know by sending an email with your accountID, the requested
features, and use case to the
Amazon DocumentDB service team
Database Commands
Aggregation
| Command | Supported |
|---|---|
|
aggregate |
Yes |
|
count |
Yes |
|
distinct |
Yes |
|
mapReduce |
No |
Query and Write Operations
| Command | Supported |
|---|---|
|
delete |
Yes |
|
find |
Yes |
|
findAndModify |
Yes |
|
getLastError |
No |
|
getMore |
Yes |
|
getPrevError |
No |
|
insert |
Yes |
|
parallelCollectionScan |
No |
|
resetError |
No |
|
update |
Yes |
|
Change streams |
Yes ( |
|
GridFS |
No |
Authentication
| Command | Supported |
|---|---|
|
authenticate |
Yes |
|
logout |
Yes |
User Management
| Command | Supported |
|---|---|
|
createUser |
Yes |
|
dropAllUsersFromDatabase |
Yes |
|
dropUser |
Yes |
|
grantRolesToUser |
Yes ( |
|
revokeRolesFromUser |
Yes ( |
|
updateUser |
Yes |
|
userInfo |
Yes |
Role Management Commands
| Command | Supported |
|---|---|
|
createRole |
No |
|
dropRole |
No |
|
dropAllRolesFromDatabase |
No |
|
grantRolesToRole |
No |
|
revokePrivilegesFromRole |
No |
|
revokeRolesFromRole |
No |
|
updateRole |
No |
|
rolesInfo |
No |
Administrative Commands
| Command | Supported |
|---|---|
|
Capped Collections |
No |
|
cloneCollectionAsCapped |
No |
|
collMod |
Partial |
|
collMod: expireAfterSeconds |
Yes ( |
|
convertToCapped |
No |
|
copydb |
No |
|
create |
Yes |
|
createView |
No |
|
createIndexes |
Yes |
|
currentOp |
Yes |
|
drop |
Yes |
|
dropDatabase |
Yes |
|
dropIndexes |
Yes |
|
filemd5 |
No |
|
killCursors |
Yes |
|
killOp |
Yes |
|
listCollections |
Yes |
|
listDatabases |
Yes |
|
listIndexes |
Yes |
|
reIndex |
No |
|
renameCollection |
No |
Diagnostic Commands
| Command | Supported |
|---|---|
|
buildInfo |
Yes |
|
collStats |
Yes |
|
connPoolStats |
No |
|
connectionStatus |
Yes |
|
dataSize |
Yes |
|
dbHash |
No |
|
dbStats |
Yes |
|
explain |
Yes |
|
explain: executionStats |
Yes ( |
|
features |
No |
|
hostInfo |
Yes |
|
listCommands |
Yes |
|
profiler |
Yes ( |
|
serverStatus |
Yes |
|
top |
Yes ( |
Query and Projection Operators
Comparison Operators
| Operator | Supported |
|---|---|
|
$eq |
Yes |
|
$gt |
Yes |
|
$gte |
Yes |
|
$lt |
Yes |
|
$lte |
Yes |
|
$ne |
Yes |
|
$in |
Yes |
|
$nin |
Yes |
Logical Operators
| Operator | Supported |
|---|---|
|
$or |
Yes |
|
$and |
Yes |
|
$not |
Yes |
|
$nor |
Yes |
Element Operators
| Operator | Supported |
|---|---|
|
$exists |
Yes |
|
$type |
Yes |
Evaluation Query Operators
| Operator | Supported |
|---|---|
|
$expr |
No |
|
$jsonSchema |
No |
|
$mod |
Yes |
|
$regex |
Yes |
|
$text |
No |
|
$where |
No |
Array Operators
| Operator | Supported |
|---|---|
|
$all |
Yes |
|
$elemMatch |
Yes |
|
$size |
Yes |
Bitwise Operators
| Operator | Supported |
|---|---|
|
$bitsAllSet |
Yes |
|
$bitsAnySet |
Yes |
|
$bitsAllClear |
Yes |
|
$bitsAnyClear |
Yes |
Comment Operator
| Operator | Supported |
|---|---|
|
$comment |
Yes |
Projection Operators
| Operator | Supported |
|---|---|
|
$ |
Yes |
|
$elemMatch |
Yes |
|
$meta |
No |
|
$slice |
Yes |
Update Operators
Field Operators
| Operator | Supported |
|---|---|
|
$inc |
Yes |
|
$mul |
Yes |
|
$rename |
Yes |
|
$setOnInsert |
Yes |
|
$set |
Yes |
|
$unset |
Yes |
|
$min |
Yes |
|
$max |
Yes |
|
$currentDate |
Yes |
Array Operators
| Operator | Supported |
|---|---|
|
$ |
Yes |
|
$[] |
Yes ( |
|
$[<identifier>] |
Yes ( |
|
$addToSet |
Yes |
|
$pop |
Yes |
|
$pullAll |
Yes |
|
$pull |
Yes |
|
$push |
Yes |
Update Modifiers
| Operator | Supported |
|---|---|
|
$each |
Yes |
|
$slice |
Yes |
|
$sort |
Yes |
|
$position |
Yes |
Bitwise Operators
| Operator | Supported |
|---|---|
|
$bit |
Yes |
Geospatial
Query Selectors
| Query Selectors | Supported |
|---|---|
|
$geoIntersects |
No |
|
$geoWithin |
No |
|
$near |
No |
|
$nearSphere |
No |
Geometry Specifiers
| Query Selectors | Supported |
|---|---|
|
$box |
No |
|
$center |
No |
|
$centerSphere |
No |
|
$nearSphere |
No |
|
$geometry |
No |
|
$maxDistance |
No |
|
$minDistance |
No |
|
$polygon |
No |
|
$uniqueDocs |
No |
Cursor Methods
| Method | Supported |
|---|---|
|
cursor.batchSize() |
Yes |
|
cursor.close() |
Yes |
|
cursor.isClosed() |
Yes |
|
cursor.collation() |
No |
|
cursor.comment() |
Yes |
|
cursor.count() |
Yes |
|
cursor.explain() |
Yes |
|
cursor.forEach() |
Yes |
|
cursor.hasNext() |
Yes |
|
cursor.hint() |
Yes ( |
|
cursor.isExhausted() |
Yes |
|
cursor.itcount() |
Yes |
|
cursor.limit() |
Yes |
|
cursor.map() |
Yes |
|
cursor.maxScan() |
Yes |
|
cursor.maxTimeMS() |
Yes |
|
cursor.max() |
No |
|
cursor.min() |
No |
|
cursor.next() |
Yes |
|
cursor.noCursorTimeout() |
No |
|
cursor.objsLeftInBatch() |
Yes |
|
cursor.pretty() |
Yes |
|
cursor.readConcern() |
Yes |
|
cursor.readPref() |
Yes |
|
cursor.returnKey() |
No |
|
cursor.showRecordId() |
No |
|
cursor.size() |
Yes |
|
cursor.skip() |
Yes |
|
cursor.sort() |
Yes |
|
cursor.tailable() |
No |
|
cursor.toArray() |
Yes |
Aggregation Pipeline Operators
Stage Operators
| Operator | Supported |
|---|---|
|
$collStats |
No |
|
$project |
Yes |
|
$match |
Yes |
|
$redact |
Yes ( |
|
$limit |
Yes |
|
$skip |
Yes |
|
$unwind |
Yes |
|
$group |
Yes |
|
$sample |
Yes ( |
|
$sort |
Yes |
|
$geoNear |
No |
|
$lookup |
Yes ( |
|
$out |
No |
|
$indexStats |
Yes ( |
|
$facet |
No |
|
$bucket |
No |
|
$bucketAuto |
No |
|
$sortByCount |
No |
|
$addFields |
Yes ( |
|
$replaceRoot |
No |
|
$count |
Yes |
|
$currentOp |
Yes |
|
$listLocalSessions |
No |
|
$listSessions |
No |
|
$graphLookup |
No |
Boolean Operators
| Operator | Supported |
|---|---|
|
$and |
Yes |
|
$or |
Yes |
|
$not |
Yes |
Set Operators
| Operator | Supported |
|---|---|
|
$setEquals |
No |
|
$setIntersection |
No |
|
$setUnion |
No |
|
$setDifference |
No |
|
$setIsSubset |
No |
|
$anyElementTrue |
No |
|
$allElementsTrue |
No |
Comparison Operators
| Operator | Supported |
|---|---|
|
$cmp |
Yes |
|
$eq |
Yes |
|
$gt |
Yes |
|
$gte |
Yes |
|
$lt |
Yes |
|
$lte |
Yes |
|
$ne |
Yes |
Arithmetic Operators
| Command | Supported |
|---|---|
|
$abs |
Yes |
|
$add |
Yes |
|
$ceil |
No |
|
$divide |
Yes |
|
$exp |
No |
|
$floor |
No |
|
$ln |
No |
|
$log |
No |
|
$log10 |
No |
|
$mod |
Yes |
|
$multiply |
Yes |
|
$pow |
No |
|
$sqrt |
No |
|
$subtract |
Yes |
|
$trunc |
No |
String Operators
| Operator | Supported |
|---|---|
|
$concat |
Yes ( |
|
$indexOfBytes |
Yes ( |
|
$indexOfCP |
Yes ( |
|
$split |
Yes ( |
|
$strcasecmp |
Yes ( |
|
$strLenBytes |
Yes ( |
|
$strLenCP |
Yes ( |
|
$substr |
Yes ( |
|
$substrBytes |
Yes ( |
|
$substrCP |
Yes ( |
|
$toLower |
Yes ( |
|
$toUpper |
Yes ( |
Text Search Operator
| Operator | Supported |
|---|---|
|
$meta |
No |
Array Operators
| Operator | Supported |
|---|---|
|
$arrayElemAt |
Yes |
|
$arrayToObject |
Yes |
|
$concatArrays |
Yes ( |
|
$filter |
Yes |
|
$indexOfArray |
No |
|
$isArray |
Yes |
|
$objectToArray |
Yes |
|
$range |
Yes |
|
$reverseArray |
No |
|
$reduce |
No |
|
$size |
Yes ( |
|
$slice |
Yes |
|
$zip |
No |
|
$in |
Yes ( |
Variable Operators
| Operator | Supported |
|---|---|
|
$map |
No |
|
$let |
No |
System Variables
| Variable | Supported |
|---|---|
|
$$CURRENT |
No |
|
$$DESCEND |
Yes ( |
|
$$KEEP |
Yes ( |
|
$$PRUNE |
Yes ( |
|
$$REMOVE |
No |
|
$$ROOT |
No |
Literal Operator
| Operator | Supported |
|---|---|
|
$literal |
No |
Natural Operator
| Operator | Supported |
|---|---|
|
$natural |
No |
Date Operators
| Operator | Supported |
|---|---|
|
$dayOfYear |
Yes ( |
|
$dayOfMonth |
Yes ( |
|
$dayOfWeek |
Yes ( |
|
$year |
Yes ( |
|
$month |
Yes ( |
|
$week |
Yes ( |
|
$hour |
Yes ( |
|
$minute |
Yes ( |
|
$second |
Yes ( |
|
$millisecond |
Yes ( |
|
$dateToString |
Yes ( |
|
$isoDayOfWeek |
Yes ( |
|
$isoWeek |
Yes ( |
|
$dateFromParts |
No |
|
$dateToParts |
No |
|
$dateFromString |
Yes ( |
|
$isoWeekYear |
Yes ( |
Conditional Expression Operators
| Operator | Supported |
|---|---|
|
$cond |
Yes |
|
$ifNull |
No |
|
$switch |
No |
Data Type Operator
| Operator | Supported |
|---|---|
|
$type |
No |
Accumulator Expressions
| Expression | Supported |
|---|---|
|
$sum |
Yes |
|
$avg |
Yes |
|
$first |
Yes |
|
$last |
Yes |
|
$max |
Yes |
|
$min |
Yes |
|
$push |
Yes ( |
|
$addToSet |
Yes ( |
|
$stdDevPop |
No |
|
$stdDevSamp |
No |
Merge Operator
| Operator | Supported |
|---|---|
|
$mergeObjects |
No |
Data Types
| Data Type | Supported |
|---|---|
|
Double |
Yes |
|
String |
Yes |
|
Object |
Yes |
|
Array |
Yes |
|
Binary Data |
Yes |
|
ObjectId |
Yes |
|
Boolean |
Yes |
|
Date |
Yes |
|
Null |
Yes |
|
32-bit Integer (int) |
Yes |
|
Timestamp |
Yes |
|
64-bit Integer (long) |
Yes |
|
MinKey |
Yes |
|
MaxKey |
Yes |
|
Decimal128 |
No |
|
Regular Expression |
No |
|
JavaScript |
No |
|
JavaScript (with scope) |
No |
|
Undefined |
No |
|
Symbol |
No |
|
DBPointer |
No |
Indexes and Index Properties
Indexes
| Index Type | Supported |
|---|---|
|
Single Field Index |
Yes |
|
Compound Index |
Yes |
|
Multikey Index |
Yes |
|
Text Index |
No |
|
2dsphere |
No |
|
2d Index |
No |
|
Hashed Index |
No |
Index Properties
| Index Property | Supported |
|---|---|
|
TTL |
Yes |
|
Unique |
Yes |
|
Partial |
No |
|
Case Insensitive |
No |
|
Sparse |
Yes |
|
Background |
Yes |