支持的 MongoDB 接口、操作和数据类型 - Amazon DocumentDB
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

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

Amazon DocumentDB(与 MongoDB 兼容)是一个快速、可扩展、高度可用且完全托管的文档数据库服务,它支持 MongoDB 工作负载。Amazon DocumentDB 与 MongoDB 3.6、4.0 和 5.0 API 兼容。本部分列出了支持的功能。要获得使用 MongoDB API 和驱动程序的支持,请查阅 MongoDB 社区论坛。如需使用亚马逊 DocumentDB 服务的支持,请联系相应的 Amazon 支持团队。有关 Amazon DocumentDB 和 MongoDB 之间的功能差异,请参阅 功能差异:Amazon DocumentDB 和 MongoDB

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

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

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

数据库命令

管理命令

命令 3.6 4.0 5.0 弹性集群

受限集合

cloneCollectionAs已封顶

collMod

部分

部分

部分

部分

collMod: expireAfterSeconds

convertToCapped

copydb

创建

createView

createIndexes

currentOp

drop

dropDatabase

dropIndexes

filemd5

killCursors

killOp

listCollections*

listDatabases

listIndexes

reIndex

renameCollection

不支持

* 不支持筛选选项中的 type 密钥。

聚合

命令 3.6 4.0 5.0 弹性集群

aggregate

count

区分

mapReduce

身份验证

命令 3.6 4.0 5.0 弹性集群

authenticate

注销

诊断命令

命令 3.6 4.0 5.0 弹性集群

buildInfo

collStats

connPoolStats

connectionStatus

dataSize

dbHash

dbStats

explain

解释:executionStats

特征

hostInfo

listCommands

profiler

不支持

serverStatus

top

查询和写入操作

命令 3.6 4.0 5.0 弹性集群

Change streams

不支持

删除

find

findAndModify

getLastError

getMore

getPrevError

GridFS

insert

parallelCollectionScan

resetError

更新

ReplaceOne

角色管理命令

命令 3.6 4.0 5.0 弹性集群

createRole

dropAllRolesFromDatabase

不支持

dropRole

不支持

grantRolesTo角色

不支持

revokeRolesFrom角色

不支持

revokePrivilegesFrom角色

不支持

rolesInfo

不支持

updateRole

不支持

会话命令

命令 3.6 4.0 5.0 弹性集群

abortTransaction

不支持

commitTransaction

不支持

endSessions

killAllSessions

killAllSessionsByPattern

killSessions

不支持

refreshSessions

startSession

不支持

用户管理

命令 3.6 4.0 5.0 弹性集群

createUser

dropAllUsersFromDatabase

dropUser

grantRolesTo用户

revokeRolesFrom用户

updateUser

用户信息

分片命令

命令 弹性集群

abortReshardCollection

addShard

addShardTo区域

balancerCollectionStatus

balancerStart

balancerStatus

balancerStop

checkShardingIndex

clearJumboFlag

cleanupOrphaned

cleanupReshardCollection

commitReshardCollection

enableSharding

flushRouterConfig

getShardMap

getShardVersion

isdbgrid

listShards

medianKey

moveChunk

movePrimary

mergeChunks

refineCollectionShard钥匙

removeShard

removeShardFrom区域

reshardCollection

setAllowMigrations

setShardVersion

shardCollection

shardingState

split

splitVector

unsetSharding

updateZoneKey射程

查询和投影运算符

数组运算符

命令 3.6 4.0 5.0 弹性集群

$all

$elemMatch

$size

按位运算符

命令 3.6 4.0 5.0 弹性集群

$bitsAllSet

$bitsAnySet

$bitsAllClear

$bitsAnyClear

评论运算符

命令 3.6 4.0 5.0 弹性集群

$comment

比较运算符

命令 3.6 4.0 5.0 弹性集群

$eq

$gt

$gte

$in

$lt

$lte

$ne

$nin

元素运算符

命令 3.6 4.0 5.0 弹性集群

$exists

$type

评估查询运算符

命令 3.6 4.0 5.0 弹性集群

$expr

不支持

$jsonSchema

不支持

$mod

$regex

$text

不支持

$where

逻辑运算符

命令 3.6 4.0 5.0 弹性集群

$and

$nor

$not

$or

投影运算符

命令 3.6 4.0 5.0 弹性集群

$

$elemMatch

$meta

不支持

$slice

更新运算符

数组运算符

命令 3.6 4.0 5.0 弹性集群

$

$[]

$[<identifier>]

$addToSet

$pop

$pullAll

$pull

$push

按位运算符

命令 3.6 4.0 5.0 弹性集群

$bit

现场操作员

运算符 3.6 4.0 5.0 弹性集群

$currentDate

$inc

$max

$min

$mul

$rename

$set

$setOnInsert

$unset

更新修饰符

运算符 3.6 4.0 5.0 弹性集群

$each

$position

$slice

$sort

地理空间

几何说明符

查询选择器 3.6 4.0 5.0 弹性集群

BOX

.center

$centerSphere

$geometry

$maxDistance

$minDistance

$nearSphere

$polygon

$uniqueDocs

查询选择器

命令 3.6 4.0 5.0 弹性集群

$geoIntersects

$geoWithin

$near

$nearSphere

$polygon

$uniqueDocs

游标方法

命令 3.6 4.0 5.0 弹性集群

cursor.batchSize()

cursor.close()

cursor.collation()

cursor.comment()

cursor.count()

cursor.explain()

不支持

cursor.forEach()

cursor.hasNext()

cursor.hint()

是*

cursor.isClosed()

cursor.isExhausted()

不支持

cursor.itcount()

不支持

cursor.limit()

不支持

cursor.map()

不支持

cursor.max()

cursor.maxScan()

不支持

cursor.maxTimeMS()

不支持

cursor.min()

cursor.next()

光标。 noCursorTimeout()

光标。 objsLeftInBatch ()

不支持

cursor.pretty()

不支持

cursor.readConcern()

不支持

cursor.readPref()

不支持

cursor.returnKey()

光标。 showRecordId()

cursor.size()

不支持

cursor.skip()

不支持

cursor.sort()

不支持

cursor.tailable()

cursor.toArray()

不支持

* 索引 hint 表达式支持索引。例如,db.foo.find().hint({x:1})

聚合管道运算符

累加器表达式

Expression 3.6 4.0 5.0 弹性集群

$accumulator

-

-

$addToSet

$avg

$count

-

-

$first

$last

$max

$min

$push

$stdDevPop

$stdDevSamp

$sum

算术运算符

命令 3.6 4.0 5.0 弹性集群

$abs

$add

$ceil

$divide

$exp

$floor

$ln

$log

$log10

$mod

$multiply

$pow

$round

-

-

$sqrt

$subtract

$trunc

数组运算符

命令 3.6 4.0 5.0 弹性集群

$arrayElemAt

$arrayToObject

$concatArrays

$filter

$first

-

-

$in

$indexOfArray

$isArray

$last

-

-

$objectToArray

$range

$reverseArray

$reduce

$size

$slice

$zip

布尔运算符

命令 3.6 4.0 5.0 弹性集群

$and

$not

$or

比较运算符

命令 3.6 4.0 5.0 弹性集群

$cmp

$eq

$gt

$gte

$lt

$lte

$ne

条件表达式运算符

命令 3.6 4.0 5.0 弹性集群

$cond

$ifNull

$switch

不支持

数据类型运算符

命令 3.6 4.0 5.0 弹性集群

$type

数据大小运算符

命令 3.6 4.0 5.0 弹性集群

$binarySize

-

-

$bsonSize

-

-

日期运算符

命令 3.6 4.0 5.0 弹性集群

$dateAdd

$dateDiff

-

-

$dateFromParts

$dateFromString

$dateSubtract

$dateToParts

$dateToString

$datetrunc

-

-

$dayOfMonth

$dayOfWeek

$dayOfYear

$hour

$ isoDayOf 周

$isoWeek

$isoWeekYear

$millisecond

$minute

$month

$second

$week

$year

字面运算符

命令 3.6 4.0 5.0 弹性集群

$literal

合并运算符

命令 3.6 4.0 5.0 弹性集群

$mergeObjects

自然运算符

命令 3.6 4.0 5.0 弹性集群

$natural

集合运算符

命令 3.6 4.0 5.0 弹性集群

$allElementsTrue

$anyElementTrue

$setDifference

$setEquals

$setIntersection

$setIsSubset

$setUnion

$setWindowFields

舞台操作员

命令 3.6 4.0 5.0 弹性集群

$addFields

$bucket

$bucketAuto

$collStats

$count

$currentOp

$facet

$geoNear

$graphLookup

$group

$indexStats

$limit

$listLocalSessions

$listSessions

$lookup

$match

merge

-

-

$out

$planCacheStats

-

-

$project

$redact

$replaceRoot

$sample

$setWindowFields

-

-

$skip

$sort

$sortByCount

$unionWith

-

-

$unset

-

-

$unwind

字符串运算符

命令 3.6 4.0 5.0 弹性集群

$concat

$indexOfBytes

$indexOfCP

$ltrim

$regxFind

-

-

$regexFindAll

-

-

$regexMatch

-

-

$replaceAll

-

-

$replaceOne

-

-

$rtrim

$split

$strcasecmp

$strLenBytes

$strLenCP

$substr

$substrBytes

$substrCP

$toLower

$toUpper

$trim

系统变量

命令 3.6 4.0 5.0 弹性集群

$$CURRENT

$$DESCEND

$$KEEP

$$PRUNE

$$REMOVE

$$ROOT

命令 3.6 4.0 5.0 弹性集群

$meta

不支持

$搜索

不支持

类型转换运算符

命令 3.6 4.0 5.0 弹性集群

$convert

$isNumber

-

-

$toBool

$toDate

$toDecimal

$toDouble

$toInt

$toLong

$toObjectId

$toString

变量运算符

命令 3.6 4.0 5.0 弹性集群

$let

$map

其他运算符

命令 3.6 4.0 5.0 弹性集群

$getField

-

-

$rand

-

-

$sampleRate

-

-

数据类型

命令 3.6 4.0 5.0 弹性集群

32-bit Integer (int)

64-bit Integer (long)

数组

二进制数据

布尔值

Date

DBPointer

DBREF

Decimal128

Double

JavaScript

JavaScript(带瞄准镜)

MaxKey

MinKey

Null

对象

ObjectId

正则表达式

String

符号

Timestamp

未定义

索引和索引属性

索引

命令 3.6 4.0 5.0 弹性集群

2dsphere

2d 索引

复合索引

哈希索引

多键索引

单个字段索引

文本索引

不支持

索引属性

命令 3.6 4.0 5.0 弹性集群

背景

不支持

区分大小写

部分

不支持

稀疏

TTL

唯一