支持的 MongoDB API、操作和数据类型

Amazon DocumentDB(与 MongoDB 兼容) 是一个快速、可扩展、高度可用且完全托管的文档数据库服务,它支持 MongoDB 工作负载。Amazon DocumentDB 与 MongoDB 3.6 API 兼容。本部分列出了支持的功能。有关 Amazon DocumentDB 和 MongoDB 之间的功能差异,请参阅功能差异:Amazon DocumentDB和 MongoDB.

仅供内部使用或不适用于完全托管的服务的 MongoDB 命令和运算符不受支持,并且未包含在支持的功能列表中。

自发布以来,我们已添加 50 多种附加功能,并将继续向客户学习以提供他们所需的功能。有关最近发布的信息,请参阅 Amazon DocumentDB 公告.

如果您希望我们构建某个不受支持的功能,请向 服务团队Amazon DocumentDB发送一封包含您的 accountID、请求的功能和使用案例的电子邮件来告知我们此情况。

数据库命令

管理命令

命令 3.6 4.0
受限集合
cloneCollectionAsCapped
collMod 部分 部分
collMod: expireAfterSeconds
convertToCapped
copydb
create
createView
createIndexes
currentOp
drop
dropDatabase
dropIndexes
filemd5
killCursors
killOp
listCollections
listDatabases
listIndexes
reIndex
renameCollection

Aggregation

命令 3.6 4.0
aggregate
count
区分
mapReduce

Authentication

命令 3.6 4.0
authenticate
logout

诊断命令

命令 3.6 4.0
buildInfo
collStats
connPoolStats
connectionStatus
dataSize
dbHash
dbStats
explain
Explain:executionStats
features
hostInfo
listCommands
profiler
serverStatus
top

查询和写入操作

命令 3.6 4.0
delete
find
findAndModify
getLastError
getMore
getPrevError
insert
parallelCollectionScan
resetError
update
Change streams
GridFS

角色管理命令

命令 3.6 4.0
createRole
dropRole
dropAllRolesFromDatabase
grantRolesToRole
revokePrivilegesFromRole
revokeRolesFromRole
updateRole
rolesInfo

会话命令

命令 3.6 4.0
abortTransaction
提交事务
endSessions
终止所有会话
终止所有会话(按模式)
终止会话
refreshSessions
startSession

用户管理

命令 3.6 4.0
createUser
dropAllUsersFromDatabase
dropUser
grantRolesToUser
revokeRolesFromUser
updateUser
userInfo

查询和投影运算符

数组运算符

命令 3.6 4.0
$all
$elemMatch
$size

按位运算符

命令 3.6 4.0
$bitsAllSet
$bitsAnySet
$bitsAllClear
$bitsAnyClear

Comment 运算符

命令 3.6 4.0
$comment

比较运算符

命令 3.6 4.0
$eq
$gt
$gte
$lt
$lte
$ne
$in
$nin

元素运算符

命令 3.6 4.0
$exists
$type

评估查询运算符

命令 3.6 4.0
$expr
$jsonSchema
$mod
$regex
$text
$where

逻辑运算符

命令 3.6 4.0
$or
$and
$not
$nor

投影运算符

命令 3.6 4.0
$
$elemMatch
$meta
$slice

更新运算符

数组运算符

命令 3.6 4.0
$
$[]
$[]
$addToSet
$pop
$pullAll
$pull
$push

按位运算符

命令 3.6 4.0
$bit

字段运算符

运算符 3.6 4.0
$inc
$mul
$rename
$setOnInsert
$set
$unset
$min
$max
$currentDate

更新修饰符

运算符 3.6 4.0
$each
$slice
$sort
$position

Geospatial

几何体说明符

查询选择器 3.6 4.0
$箱
$中心
$中心球体
$nearSphere
$几何体
$maxDistance
$最小实例
$多边形
$ UniqueDocs

查询选择器

命令 3.6 4.0
$地理节
$地理线 ($geoWithin)
美元最近
$nearSphere
$多边形
$ UniqueDocs

游标方法

命令 3.6 4.0
cursor.batchSize()
cursor.close()
cursor.isClosed()
cursor.collation()
cursor.comment()
cursor.count()
cursor.explain()
cursor.forEach()
cursor.hasNext()
cursor.hint()
cursor.isExhausted()
cursor.itcount()
cursor.limit()
cursor.map()
cursor.maxScan()
cursor.maxTimeMS()
cursor.max()
cursor.min()
cursor.next()
cursor.noCursorTimeout()
cursor.objsLeftInBatch()
cursor.pretty()
cursor.readConcern()
cursor.readPref()
cursor.returnKey()
cursor.showRecordId()
cursor.size()
cursor.skip()
cursor.sort()
cursor.tailable()
cursor.toArray()

聚合管道运算符

累加器表达式

表达式 3.6 4.0
$sum
$avg
$first
$last
$max
$min
$push
$addToSet
$stdDevPop
$stdDevSamp

算术运算符

命令 3.6 4.0
$abs
$add
$ceil
$divide
$exp
$floor
$ln
$log
$log10
$mod
$multiply
$pow
$sqrt
$subtract
$trunc

数组运算符

命令 3.6 4.0
$arrayElemAt
$arrayToObject
$concatArrays
$filter
$indexOfArray
$isArray
$objectToArray
$range
$reverseArray
$reduce
$size
$slice
$zip
$in

布尔运算符

命令 3.6 4.0
$and
$or
$not

比较运算符

命令 3.6 4.0
$cmp
$eq
$gt
$gte
$lt
$lte
$ne

条件表达式运算符

命令 3.6 4.0
$cond
$ifNull
$switch

数据类型运算符

命令 3.6 4.0
$type

日期运算符

命令 3.6 4.0
$dayOfYear
$dayOfMonth
$dayOfWeek
$year
$month
$week
$hour
$minute
$second
$millisecond
$dateToString
$isoDayOfWeek
$isoWeek
$dateFromParts
$dateToParts
$dateFromString
$isoWeekYear

文字运算符

命令 3.6 4.0
$literal

合并运算符

命令 3.6 4.0
$mergeObjects

自然运算符

命令 3.6 4.0
$自然

集合运算符

命令 3.6 4.0
$setEquals
$setIntersection
$setUnion
$setDifference
$setIsSubset
$anyElementTrue
$allElementsTrue

阶段运算符

命令 3.6 4.0
$collStats
$project
$match
$redact
$limit
$skip
$unwind
$group
$sample
$sort
$geoNear
$lookup
$out
$indexStats
$facet
$bucket
$bucketAuto
$sortByCount
$addFields
$replaceRoot
$count
$currentOp
$listLocalSessions
$listSessions
$graphLookup

字符串运算符

命令 3.6 4.0
$concat
$indexOfBytes
$indexOfCP
克拉里
$符
$split
$strcasecmp
$strLenBytes
$strLenCP
$substr
$substrBytes
$substrCP
$toLower
$toUpper
$要

系统变量

命令 3.6 4.0
$$CURRENT
$$DESCEND
$$KEEP
$$PRUNE
$$REMOVE
$$ROOT

文本搜索运算符

命令 3.6 4.0
$meta

类型转换运算符

命令 3.6 4.0
$转换
$到布尔值
设为 $toDate
$到十进制
$toDouble
$到整数
$到长整型
$到对象 ID
$到字符串

变量运算符

命令 3.6 4.0
$map
$let

数据类型

命令 3.6 4.0
Double
字符串
Object
数组
二进制数据
ObjectId
Boolean
日期
Null
位整数 (int)
时间戳
64 位 整数 (长整型)
MinKey
MaxKey
Decimal128
常规 表达式
JavaScript
JavaScript (带 范围)
未定义
符号
DBPointer

索引和索引属性

Indexes

命令 3.6 4.0
单个字段索引
复合索引
多键索引
文本索引
2dsphere
2d 索引
哈希索引

索引属性

命令 3.6 4.0
TTL
唯一
部分
区分大小写
稀疏
背景