支援的功能:8.0

下表列出與 MongoDB 相容的 Firestore 支援的 MongoDB 8.0 功能。如要瞭解行為差異,請參閱「行為差異」。

查詢和投影運算子

與 MongoDB 相容的 Firestore 支援下列查詢和投影運算子:

陣列運算子

運算子 支援
$all
$elemMatch
$size

位元運算子

運算子 支援
$bitsAllClear
$bitsAllSet
$bitsAnyClear
$bitsAnySet

註解運算子

運算子 支援
$comment

比較運算子

運算子 支援
$eq
$gt
$gte
$in
$lt
$lte
$ne
$nin

元素運算子

運算子 支援
$exists
$type

評估查詢運算子

運算子 支援
$expr
$jsonSchema
$mod
$regex
$text
$where

邏輯運算子

運算子 支援
$and
$nor
$not
$or

投影運算子

運算子 支援
$
$elemMatch
$meta
$slice

更新業者

與 MongoDB 相容的 Firestore 支援下列更新運算子。

陣列運算子

運算子 支援
$
$[]
$[<identifier>]
$addToSet
$pop
$pull
$pullAll
$push

位元運算子

運算子 支援
$bit

現場作業人員

運算子 支援
$currentDate
$inc
$max
$min
$mul
$rename
$set
$setOnInsert
$unset

更新修飾符

修飾符 支援
$each
$position
$slice
$sort

匯總管道運算子

與 MongoDB 相容的 Firestore 支援下列匯總管道運算子。

累加器運算式

Expression 支援
$accumulator
$addToSet
$avg
$bottom
$bottomN
$count
$first
$firstN
$last
$lastN
$max
$min
$minN
$push
$stdDevPop
$stdDevSamp
$sum
$top
$topN

算術運算子

運算子 支援
$abs
$add
$ceil
$divide
$exp
$floor
$ln
$log
$log10
$mod
$multiply
$pow
$round
$sqrt
$subtract
$trunc

陣列運算子

運算子 支援
$arrayElemAt
$arrayToObject
$concatArrays
$filter
$firstN
$in
$indexOfArray
$isArray
$lastN
$maxN
$minN
$objectToArray
$range
$reduce
$reverseArray
$size
$slice
$sortArray
$zip

布林運算子

運算子 支援
$and
$not
$or

比較運算子

運算子 支援
$cmp
$eq
$gt
$gte
$lt
$lte
$ne

條件運算式運算子

運算子 支援
$cond
$ifNull
$switch

資料大小運算子

運算子 支援
$binarySize
$bsonSize

日期運算子

運算子 支援
$dateAdd
$dateDiff
$dateFromParts
$dateFromString
$dateSubtract
$dateToParts
$dateToString
$dateTrunc
$dayOfMonth
$dayOfWeek
$dayOfYear
$hour
$isoDayOfWeek
$isoWeek
$isoWeekYear
$millisecond
$minute
$month
$second
$tsIncrement
$tsSecond
$week
$year

其他運算子

運算子 支援
$getField
$literal
$mergeObjects
$natural
$rand
$sampleRate

集合運算子

運算子 支援
$allElementsTrue
$anyElementTrue
$setDifference
$setEquals
$setIntersection
$setIsSubset
$setUnion
$setWindowFields

舞台經營者

運算子 支援
$addFields
$bucket
$bucketAuto
$changeStreams
$collStats
$count
$currentOp
$documents
$facet
$geoNear
$graphLookup
$group
$indexStats
$limit
$listLocalSessions
$listSessions
$lookup
$match
$merge
$out
$planCacheStats
$project
$redact
$replaceRoot
$replaceWith
$sample
$set
$setWindowFields
$skip
$sort
$sortByCount
$unionWith
$unset
$unwind

字串運算子

運算子 支援
$concat
$indexOfBytes
$indexOfCP
$ltrim
$regexFind
$regexFindAll
$regexMatch
$replaceAll
$replaceOne
$rtrim
$split
$strcasecmp
$strLenBytes
$strLenCP
$substr
$substrBytes
$substrCP
$toLower
$toUpper
$trim

系統變數

變數 支援
$$CLUSTERTIME No
$$CURRENT
$$DESCEND No
$$KEEP
$$NOW Yes
$$PRUNE
$$REMOVE Yes
$$ROOT

文字搜尋運算子

運算子 支援
$meta
$search

三角運算子

運算子 支援
$acos
$acosh
$asin
$asinh
$atan
$atan2
$atanh
$cos
$cosh
$degreesToRadians
$radiansToDegrees
$sin
$sinh
$tan
$tanh

型別轉換運算子

運算子 支援
$convert
$isNumber
$toBool
$toDate
$toDecimal
$toDouble
$toInt
$toLong
$toObjectId
$toString
$type

變數運算子

運算子 支援
$let
$map

地理空間

與 MongoDB 相容的 Firestore 支援下列地理空間運算子。

幾何指定碼

指定符 支援
$box
$center
$centerSphere
$geometry
$maxDistance
$minDistance
$polygon
$uniqueDocs

查詢選取器

選取器 支援
$geoIntersects
$geoWithin
$near
$nearSphere
$nearSphere
$uniqueDocs

索引和索引屬性

與 MongoDB 相容的 Firestore 支援下列索引和索引運算子。

索引

索引類型 支援
2 天
2dsphere
建築
已雜湊
多重金鑰
單一欄位
文字

索引屬性

屬性 支援
背景
不區分大小寫
隱藏
部分
非稀疏
稀疏
文字
存留時間
不重複
萬用字元
向量

資料庫指令

與 MongoDB 相容的 Firestore 支援下列資料庫指令。

匯總

指令 支援
aggregate
count
distinct
group

匯總作業支援 $group 階段,但不支援群組指令。

mapReduce

驗證

指令 支援
authenticate
getnonce
logout

查詢和寫入作業

指令 支援
watch (變更串流)
delete
eval
find
findAndModify
getLastError
getMore
getPrevError
GridFS
insert
parallelCollectionScan
replaceOne

replaceOne 驅動程式方法支援 update 指令。

resetError
update

工作階段指令

指令 支援
abortTransaction
commitTransaction
endSessions
killAllSessions
killAllSessionsByPattern
killSessions
refreshSessions
startSession

您可以使用 startSession 驅動程式方法啟動工作階段。

管理指令

與 MongoDB 相容的 Firestore 支援下列管理指令。

指令 支援
cloneCollectionAsCapped
collMod
collMod: expireAfterSeconds
convertToCapped
copydb
create
createIndexes

如要建立索引,請參閱「管理索引」。

createView
currentOp
drop
dropDatabase

如要刪除資料庫,請參閱「刪除資料庫」。

dropIndexes

如要刪除索引,請參閱「管理索引」。

filemd5
getAuditConfig
killCursors
killOp
listCollections
listDatabases
listIndexes
reIndex
renameCollection
setAuditConfig

診斷指令

指令 支援
buildInfo
collStats
connectionStatus
connPoolStats
dataSize
dbHash
dbStats
explain

如要瞭解行為差異和限制,請參閱「查詢說明

features
hello
hostInfo
listCommands
profiler
serverStatus
top
whatsmyuri

角色管理指令

如要管理資料庫存取權,與 MongoDB 相容的 Firestore 支援身分與存取權管理角色和權限

指令 支援
createRole
dropAllRolesFromDatabase
dropRole
grantRolesToRole
revokePrivilegesFromRole
revokeRolesFromRole
rolesInfo
updateRole

後續步驟