View a markdown version of this page

Amazon DocumentDB 中支持的 MongoDB API、操作和数据类型 - Amazon DocumentDB

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

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

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

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

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

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

主题

数据库命令

管理命令

命令 3.6 4.0 5.0 8.0 弹性集群

受限集合

克隆 CollectionAsCapped

collMod

部分

部分

部分

部分

部分

collMod:过期 AfterSeconds

支持

转换 ToCapped

copydb

创建

支持

createView

createIndexes

支持

currentOp

支持

drop

支持

dropDatabase

支持

dropIndexes

支持

filemd5

得到 AuditConfig

killCursors

支持

killOp

支持

listCollections*

支持

listDatabases

支持

listIndexes

支持

reIndex

renameCollection

支持

设置 AuditConfig

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

聚合

命令 3.6 4.0 5.0 8.0 弹性集群

aggregate

支持

count

支持

区分

支持

mapReduce

身份验证

命令 3.6 4.0 5.0 8.0 弹性集群

authenticate

支持

注销

支持

诊断命令

命令 3.6 4.0 5.0 8.0 弹性集群

buildInfo

支持

collStats

支持

conn PoolStats

connectionStatus

支持

dataSize

支持

dbHash

dbStats

支持

explain

支持

解释:executionStats

支持

功能

hostInfo

支持

listCommands

支持

profiler

serverStatus

支持

top

支持

查询和写入操作

命令 3.6 4.0 5.0 8.0 弹性集群

变更流

删除

支持

查找

支持

找到 AndModify

支持

得到 LastError

getMore

支持

得到 PrevError

GridFS

支持

insert

支持

parallel CollectionScan

resetError

更新

支持

ReplaceOne

角色管理命令

命令 3.6 4.0 5.0 8.0 弹性集群

createRole

支持

掉落 AllRolesFromDatabase

支持

dropRole

支持

授予 RolesToRole

支持

撤销 RolesFromRole

支持

撤销 PrivilegesFromRole

支持

rolesInfo

支持

updateRole

支持

会话命令

命令 3.6 4.0 5.0 8.0 弹性集群

abortTransaction

commitTransaction

endSessions

杀 AllSessions

杀 AllSessionsByPattern

killSessions

refreshSessions

startSession

User management

命令 3.6 4.0 5.0 8.0 弹性集群

createUser

支持

掉落 AllUsersFromDatabase

支持

dropUser

支持

授予 RolesToUser

支持

撤销 RolesFromUser

支持

updateUser

支持

usersInfo

支持

分片命令

命令 弹性集群

中止 ReshardCollection

addShard

添加 ShardToZone

平衡器 CollectionStatus

balancerStart

balancerStatus

balancerStop

检查 ShardingIndex

清除 JumboFlag

cleanupOrphaned

清理 ReshardCollection

提交 ReshardCollection

enableSharding

脸红 RouterConfig

得到 ShardMap

得到 ShardVersion

isdbgrid

listShards

medianKey

moveChunk

movePrimary

mergeChunks

完善 CollectionShardKey

removeShard

移除 ShardFromZone

reshardCollection

设置 AllowMigrations

设置 ShardVersion

shardCollection

shardingState

split

splitVector

unsetSharding

更新 ZoneKeyRange

查询和投影运算符

数组运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$all

支持

$elemMatch

$size

按位运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$bits AllSet

支持

$bits AnySet

$bits AllClear

$bits AnyClear

注释运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$comment

支持

比较运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$eq

支持

$gt

$gte

$in

$lt

$lte

$ne

$nin

元素运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$exists

支持

$type

评估查询运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$expr

$jsonSchema

$mod

$regex

$text

$where

逻辑运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$and

支持

$nor

$not

$or

投影运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$

支持

$elemMatch

$meta

$slice

更新运算符

数组运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$

支持

$[]

$ [<标识符>]

$addToSet

支持

$pop

支持

$pullAll

支持

$pull

支持

$push

支持

按位运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$bit

支持

字段运算符

运算符 3.6 4.0 5.0 8.0 弹性集群

$currentDate

支持

$inc

支持

$max

$min

$mul

支持

$rename

支持

$set

$setOnInsert

支持

$unset

更新修改器

运算符 3.6 4.0 5.0 8.0 弹性集群

$each

支持

$position

支持

$slice

$sort

地理空间

几何说明符

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

BOX

.center

$centerSphere

$geometry

$maxDistance

$minDistance

$nearSphere

$polygon

$uniqueDocs

查询选择器

命令 3.6 4.0 5.0 8.0 弹性集群

$geoIntersects

支持

$geoWithin

$near

$nearSphere

$polygon

$uniqueDocs

游标方法

命令 3.6 4.0 5.0 8.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()

支持

cursor.no CursorTimeout ()

cursor.objs LeftInBatch ()

支持

cursor.pretty()

支持

cursor.readConcern()

支持

cursor.readPref()

支持

cursor.returnKey()

cursor.show RecordId ()

cursor.size()

支持

cursor.skip()

支持

cursor.sort()

支持

cursor.tailable()

cursor.toArray()

支持

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

聚合管道运算符

累加器表达式

Expression 3.6 4.0 5.0 8.0 弹性集群

$accumulator

-

-

$add ToSet

$avg

$count

-

-

$covariancePop

$covarianceSamp

$denseRank

$derivative

$documentNumber

$exp MovingAvg

$first

$integral

$last

$max

$min

$push

$rank

$shift

$std DevPop

$std DevSamp

$sum

算术运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$abs

支持

$add

$ceil

$divide

$exp

$floor

$ln

$log

$log10

$mod

$multiply

$pow

是的 (5.0.1+)

$round

-

-

$sqrt

$subtract

$trunc

数组运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$array ElemAt

支持

$array ToObject

$concatArrays

$filter

$first

-

-

$in

$index OfArray

$isArray

$last

-

-

$object ToArray

$range

$reverseArray

$reduce

$size

$slice

$zip

布尔运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$and

支持

$not

$or

比较运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$cmp

支持

$eq

$gt

$gte

$lt

$lte

$ne

条件表达式运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$cond

支持

$ifNull

$switch

数据类型运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$type

支持

数据大小运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$binarySize

-

-

$bsonSize

-

-

日期运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$dateAdd

$dateDiff

-

-

$date FromParts

是的 (5.0.1+)

$date FromString

$dateSubtract

$date ToParts

是的 (5.0.1+)

$date ToString

$dateTrunc

-

-

$day OfMonth

$day OfWeek

$day OfYear

$hour

$iso DayOfWeek

$isoWeek

$iso WeekYear

$millisecond

$minute

$month

$second

$week

$year

文字运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$literal

支持

合并运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$mergeObjects

支持

自然运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$natural

支持

集合运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$all ElementsTrue

$any ElementTrue

$setDifference

$setEquals

$setIntersection

$set IsSubset

$setUnion

$set WindowFields

阶段运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$addFields

支持

$bucket

$bucketAuto

$changeStream

$collStats

$count

$currentOp

$facet

$geoNear

$graphLookup

$group

$indexStats

$limit

$list LocalSessions

$listSessions

$lookup

$match

merge

-

-

$out

$plan CacheStats

-

-

$project

$redact

$replaceRoot

$sample

$set

-

-

$set WindowFields

-

-

$skip

$sort

$sort ByCount

$unionWith

-

-

$unset

-

-

$unwind

$replaceWith

$向量搜索

字符串运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$concat

支持

$index OfBytes

$indexOfCP

$ltrim

$regexFind

-

-

$正则表达式 FindAll

-

-

$regexMatch

-

-

$replaceAll

-

-

$replaceOne

-

-

$rtrim

$split

$strcasecmp

$str LenBytes

$strLenCP

$substr

$substrBytes

$substrCP

$toLower

$toUpper

$trim

系统变量

命令 3.6 4.0 5.0 8.0 弹性集群

$$CURRENT

$$DESCEND

$$KEEP

$$PRUNE

$$REMOVE

$ROOT

命令 3.6 4.0 5.0 8.0 弹性集群

$meta

$search

类型转换运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$convert

$isNumber

-

-

$toBool

$toDate

$toDecimal

$toDouble

$toInt

$toLong

$to ObjectId

$toString

变量运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$let

支持

$map

其他运算符

命令 3.6 4.0 5.0 8.0 弹性集群

$getField

-

-

$rand

-

-

是的 (5.0.1+)

$sampleRate

-

-

数据类型

命令 3.6 4.0 5.0 8.0 弹性集群

32-bit Integer (int)

支持

64-bit Integer (long)

支持

数组

支持

二进制数据

支持

布尔值

支持

日期

支持

DBPointer

DBREF

Decimal128

支持

双精度

支持

JavaScript

JavaScript(带瞄准镜)

MaxKey

MinKey

Null

支持

对象

支持

ObjectId

正则表达式

支持

字符串

符号

Timestamp

支持

未定义

索引和索引属性

索引

命令 3.6 4.0 5.0 8.0 弹性集群

2dsphere

支持

2d 索引

复合索引

支持

哈希索引

多键索引

支持

单个字段索引

支持

文本索引

通配符

索引属性

命令 3.6 4.0 5.0 8.0 弹性集群

背景

支持

区分大小写

隐藏

部分

稀疏

支持

文本

TTL

支持

Unique

支持

向量

有关特定 MongoDB 运算符的详细信息,请参阅以下主题: