적용 대상:
MongoDB vCore
Azure Cosmos DB for MongoDB vCore를 사용하면 Azure Cosmos DB에서 제공하는 향상된 엔터프라이즈 기능에 액세스하면서 친숙한 MongoDB 이점을 경험할 수 있습니다. MongoDB 유선 프로토콜을 따라 호환성을 보장하므로 이미 익숙한 기존 클라이언트 드라이버, SDK 및 기타 도구를 적용할 수 있습니다.
프로토콜 지원
지원되는 연산자 및 제한 사항이나 예외는 다음과 같습니다. 이러한 프로토콜을 인식하는 모든 클라이언트 드라이버는 Azure Cosmos DB for MongoDB에 연결할 수 있습니다. Azure Cosmos DB for MongoDB vCore 클러스터를 만들 때 엔드포인트는 형식 *.mongocluster.cosmos.azure.com
입니다.
쿼리 언어 지원
Azure Cosmos DB for MongoDB는 MongoDB 쿼리 언어 구문을 포괄적으로 지원합니다. 아래에서 현재 지원되는 데이터베이스 명령, 연산자, 단계, 명령 및 옵션에 대한 자세한 목록을 찾을 수 있습니다.
참고 항목
이 문서에서는 지원되는 서버 명령만 나열하고 클라이언트 쪽 래퍼 함수는 제외합니다.
deleteMany()
및 updateMany()
와 같은 클라이언트 쪽 래퍼 함수는 내부적으로 delete()
및 update()
서버 명령을 활용합니다. 지원되는 서버 명령을 활용하는 기능은 Azure Cosmos DB for MongoDB와 호환됩니다.
데이터베이스 명령
Azure Cosmos DB for MongoDB는 다음과 같은 데이터베이스 명령을 지원합니다.
범주 | 명령 | 기능 | ||
v5.0 | v6.0 | v7.0 | ||
관리 명령 | cloneCollectionAsCapped |
| ||
collMod |
|
|
| |
compact |
|
|
| |
convertToCapped |
| |||
create |
|
|
| |
createIndexes |
|
|
| |
currentOp |
|
|
| |
drop |
|
|
| |
dropDatabase |
|
|
| |
dropConnections | PaaS 서비스로 Azure에서 관리됩니다. | |||
dropIndexes |
|
|
| |
filemd5 |
|
|
| |
fsync | PaaS 서비스로 Azure에서 관리됩니다. | |||
fsyncUnlock | PaaS 서비스로 Azure에서 관리됩니다. | |||
getDefaultRWConcern |
|
|
| |
getClusterParameter |
|
| ||
getParameter |
|
|
| |
killCursors |
|
|
| |
killOp |
|
|
| |
listCollections |
|
|
| |
listDatabases |
|
|
| |
listIndexes |
|
|
| |
logRotate | PaaS 서비스로 Azure에서 관리됩니다. | |||
reIndex |
|
|
| |
renameCollection |
|
|
| |
rotateCertificates | PaaS 서비스로 Azure에서 관리됩니다. | |||
setFeatureCompatibilityVersion | PaaS 서비스로 Azure에서 관리됩니다. | |||
setIndexCommitQuorum |
|
|
| |
setParameter |
|
|
| |
setDefaultRWConcern |
|
|
| |
validateDBMetadata |
|
|
| |
shutdown | PaaS 서비스로 Azure에서 관리됩니다. | |||
compactStructuredEncryptionData | PaaS 서비스로 Azure에서 관리됩니다. | |||
setUserWriteBlockMode | PaaS 서비스로 Azure에서 관리됩니다. | |||
집계 명령 |
집계 |
|
|
|
count |
|
|
| |
distinct |
|
|
| |
mapReduce | MongoDB 5.0에서 사용되지 않음 | |||
인증 명령 | authenticate |
|
|
|
logout | MongoDB 5.0에서 사용되지 않음 | |||
진단 명령 | buildInfo |
|
|
|
collStats |
|
|
| |
connPoolStats |
|
|
| |
connectionStatus |
|
|
| |
dataSize |
|
|
| |
dbHash |
|
|
| |
dbStats |
|
|
| |
explain |
|
|
| |
getCmdLineOpts |
|
|
| |
getLog |
|
|
| |
hello |
|
|
| |
hostInfo |
|
|
| |
listCommands |
|
|
| |
lockInfo |
|
|
| |
ping |
|
|
| |
profile | PaaS 서비스로 Azure에서 관리됩니다. | |||
serverStatus |
|
|
| |
shardConnPoolStats | MongoDB 5.0에서 사용되지 않습니다. 대안: connPoolStats | |||
top |
|
|
| |
validate |
|
|
| |
whatsmyuri |
|
|
| |
지리 공간적 명령 | geoSearch | MongoDB 5.0에서 사용되지 않음 | ||
쿼리 및 쓰기 작업 명령 | bulkWrite |
|
|
|
delete |
|
|
| |
find |
|
|
| |
findAndModify |
|
|
| |
getLastError | MongoDB 5.1에서 사용되지 않음 | |||
getMore |
|
|
| |
insert |
|
|
| |
resetError | MongoDB 5.0에서 사용되지 않음 | |||
update |
|
|
| |
쿼리 계획 캐시 명령 | PaaS 서비스로 Azure에서 관리됩니다. | |||
복제 명령 | Azure가 복제를 관리하므로 고객이 수동으로 복제할 필요가 없습니다. | |||
역할 관리 명령 | 현재는 지원되지 않지만 나중에 Azure Active Directory를 통해 사용할 수 있습니다. | |||
세션 명령 | abortTransaction |
|
|
|
commitTransaction |
|
|
| |
endSessions |
|
|
| |
killAllSessions |
|
|
| |
killAllSessionsByPattern |
|
|
| |
killSessions |
|
|
| |
refreshSessions |
|
|
| |
startSession |
|
|
| |
분할 명령 | enableSharding |
|
|
|
isdbgrid |
|
|
| |
reshardCollection |
|
|
| |
shardCollection |
|
|
| |
unsetSharding | MongoDB 5.0에서 사용되지 않음 | |||
addShard | PaaS(Platform-as-a-Service) 제품인 Azure는 분할된 데이터베이스 관리 및 리밸런싱을 관리합니다. 사용자가 컬렉션에 대한 분할 전략만 지정하면 Azure가 나머지를 처리합니다. | |||
addShardToZone | ||||
clearJumboFlag | ||||
abortUnshardCollection | ||||
removeShard | ||||
removeShardFromZone | ||||
setShardVersion | ||||
mergeChunks | ||||
abortMoveCollection | ||||
getShardMap | ||||
analyzeShardKey | ||||
medianKey | ||||
checkMetadataConsistency | ||||
shardingState | ||||
cleanupReshardCollection | ||||
flushRouterConfig | ||||
balancerCollectionStatus | ||||
balancerStart | ||||
balancerStatus | ||||
balancerStop | ||||
configureCollectionBalancing | ||||
listShards | ||||
split | ||||
moveChunk | ||||
updateZoneKeyRange | ||||
movePrimary | ||||
moveRange | ||||
abortReshardCollection | ||||
commitReshardCollection | ||||
refineCollectionShardKey | ||||
configureQueryAnalyzer | ||||
transitionFromDedicatedConfigServer | ||||
transitionToDedicatedConfigServer | ||||
unshardCollection | ||||
시스템 이벤트 감사 명령 | logApplicationMessage |
|
|
|
사용자 관리 명령 | createUser |
|
|
|
dropUser |
|
|
| |
usersInfo |
|
|
| |
dropAllUsersFromDatabase | 현재는 지원되지 않지만 나중에 Azure Active Directory를 통해 사용할 수 있습니다. | |||
grantRolesToUser | ||||
revokeRolesFromUser | ||||
updateUser |
연산자
다음은 현재 Azure Cosmos DB for MongoDB vCore에서 지원되는 연산자 목록입니다.
참고 항목
"collStats" 및 "dbStats"의 AvgObjsize 및 크기는 문서 크기가 2KB 미만인 경우에만 작동합니다.
범주 | 명령 | 기능 | ||
v5.0 | v6.0 | v7.0 | ||
비교 쿼리 연산자 | $eq |
|
|
|
$gt |
|
|
| |
$gte |
|
|
| |
$in |
|
|
| |
$lt |
|
|
| |
$lte |
|
|
| |
$ne |
|
|
| |
$nin |
|
|
| |
논리 쿼리 연산자 | $and |
|
|
|
$not |
|
|
| |
$nor |
|
|
| |
$or |
|
|
| |
요소 쿼리 연산자 | $exists |
|
|
|
$type |
|
|
| |
평가 쿼리 연산자 | $expr |
|
|
|
$jsonSchema* |
|
|
| |
$mod |
|
|
| |
$regex |
|
|
| |
$text |
|
|
| |
$where |
|
|
| |
지리 공간적 연산자 | $geoIntersects |
|
|
|
$geoWithin |
|
|
| |
$box |
|
|
| |
$center |
|
|
| |
$centerSphere |
|
|
| |
$geometry |
|
|
| |
$maxDistance |
|
|
| |
$minDistance |
|
|
| |
$polygon |
|
|
| |
$near |
|
|
| |
$nearSphere |
|
|
| |
배열 쿼리 연산자 | $all |
|
|
|
$elemMatch |
|
|
| |
$size |
|
|
| |
비트 쿼리 연산자 | $bitsAllClear |
|
|
|
$bitsAllSet |
|
|
| |
$bitsAnyClear |
|
|
| |
$bitsAnySet |
|
|
| |
프로젝션 연산자 | $ |
|
|
|
$elemMatch |
|
|
| |
$meta |
|
|
| |
$slice |
|
|
| |
기타 쿼리 연산자 | $comment |
|
|
|
$rand |
|
|
| |
$natural |
|
|
| |
필드 업데이트 연산자 | $currentDate |
|
|
|
$inc |
|
|
| |
$min |
|
|
| |
$max |
|
|
| |
$mul |
|
|
| |
$rename |
|
|
| |
$set |
|
|
| |
$setOnInsert |
|
|
| |
$unset |
|
|
| |
배열 업데이트 연산자 | $ |
|
|
|
$[] |
|
|
| |
$[identifier] |
|
|
| |
$addToSet |
|
|
| |
$pop |
|
|
| |
$pull |
|
|
| |
$push |
|
|
| |
$pullAll |
|
|
| |
$each |
|
|
| |
$position |
|
|
| |
$slice |
|
|
| |
$sort |
|
|
| |
비트 업데이트 연산자 | $bit |
|
|
|
산술 식 연산자 | $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 |
|
|
| |
$map |
|
|
| |
$maxN |
|
| ||
$minN |
|
| ||
$objectToArray |
|
|
| |
$range |
|
|
| |
$reduce |
|
|
| |
$reverseArray |
|
|
| |
$size |
|
|
| |
$slice |
|
|
| |
$sortArray |
|
| ||
$zip |
|
|
| |
비트 연산자 | $bitAnd |
|
|
|
$bitNot |
|
|
| |
$bitOr |
|
|
| |
$bitXor |
|
|
| |
부울 식 연산자 | $and |
|
|
|
$not |
|
|
| |
$or |
|
|
| |
비교 식 연산자 | $cmp |
|
|
|
$eq |
|
|
| |
$gt |
|
|
| |
$gte |
|
|
| |
$lt |
|
|
| |
$lte |
|
|
| |
$ne |
|
|
| |
사용자 지정 집계 식 연산자 | 아직 지원되지 않습니다. | |||
데이터 크기 연산자 | $bsonSize |
|
|
|
$binarySize |
|
|
| |
데이터 식 연산자 | $dateAdd |
|
|
|
$dateDiff |
|
|
| |
$dateFromParts |
|
|
| |
$dateFromString |
|
|
| |
$dateSubtract |
|
|
| |
$dateToParts |
|
|
| |
$dateToString |
|
|
| |
$dateTrunc |
|
|
| |
$dayOfMonth |
|
|
| |
$dayOfWeek |
|
|
| |
$dayOfYear |
|
|
| |
$hour |
|
|
| |
$isoDayOfWeek |
|
|
| |
$isoWeek |
|
|
| |
$isoWeekYear |
|
|
| |
$millisecond |
|
|
| |
$minute |
|
|
| |
$month |
|
|
| |
$second |
|
|
| |
$toDate |
|
|
| |
$week |
|
|
| |
$year |
|
|
| |
리터럴 식 연산자 | $literal |
|
|
|
기타 연산자 | $getField |
|
|
|
$rand |
|
|
| |
$sampleRate |
|
|
| |
개체 식 연산자 | $mergeObjects |
|
|
|
$objectToArray |
|
|
| |
$setField |
|
|
| |
집합 식 연산자 | $allElementsTrue |
|
|
|
$anyElementTrue |
|
|
| |
$setDifference |
|
|
| |
$setEquals |
|
|
| |
$setIntersection |
|
|
| |
$setIsSubset |
|
|
| |
$setUnion |
|
|
| |
문자열 식 연산자 | $concat |
|
|
|
$dateFromString |
|
|
| |
$dateToString |
|
|
| |
$indexOfBytes |
|
|
| |
$indexOfCP |
|
|
| |
$ltrim |
|
|
| |
$regexFind |
|
|
| |
$regexFindAll |
|
|
| |
$regexMatch |
|
|
| |
$replaceOne |
|
|
| |
$replaceAll |
|
|
| |
$rtrim |
|
|
| |
$split |
|
|
| |
$strLenBytes |
|
|
| |
$strLenCP |
|
|
| |
$strcasecmp |
|
|
| |
$substr |
|
|
| |
$substrBytes |
|
|
| |
$substrCP |
|
|
| |
$toLower |
|
|
| |
$toString |
|
|
| |
$trim |
|
|
| |
$toUpper |
|
|
| |
텍스트 식 연산자 | $meta |
|
|
|
타임스탬프 식 연산자 | $tsIncrement |
|
|
|
$tsSecond |
|
|
| |
삼각 식 연산자 | $sin |
|
|
|
$cos |
|
|
| |
$tan |
|
|
| |
$asin |
|
|
| |
$acos |
|
|
| |
$atan |
|
|
| |
$atan2 |
|
|
| |
$asinh |
|
|
| |
$acosh |
|
|
| |
$atanh |
|
|
| |
$sinh |
|
|
| |
$cosh |
|
|
| |
$tanh |
|
|
| |
$degreesToRadians |
|
|
| |
$radiansToDegrees |
|
|
| |
유형 식 연산자 | $convert |
|
|
|
$isNumber |
|
|
| |
$toBool |
|
|
| |
$toDate |
|
|
| |
$toDecimal |
|
|
| |
$toDouble |
|
|
| |
$toInt |
|
|
| |
$toLong |
|
|
| |
$toObjectId |
|
|
| |
$toString |
|
|
| |
$type |
|
|
| |
누산기($group, $bucket, $bucketAuto, $setWindowFields) | $accumulator |
|
|
|
$addToSet |
|
|
| |
$avg |
|
|
| |
$bottom |
|
| ||
$bottomN |
|
| ||
$count |
|
|
| |
$first |
|
|
| |
$firstN |
|
|
| |
$last |
|
|
| |
$lastN |
|
|
| |
$max |
|
|
| |
$maxN |
|
| ||
$median |
|
|
| |
$mergeObjects |
|
|
| |
$min |
|
|
| |
$percentile |
|
|
| |
$push |
|
|
| |
$stdDevPop |
|
|
| |
$stdDevSamp |
|
|
| |
$sum |
|
|
| |
$top |
|
| ||
$topN |
|
| ||
누산기(다른 단계) | $avg |
|
|
|
$first |
|
|
| |
$last |
|
|
| |
$max |
|
|
| |
$median |
|
|
| |
$min |
|
|
| |
$percentile |
|
|
| |
$stdDevPop |
|
|
| |
$stdDevSamp |
|
|
| |
$sum |
|
|
| |
변수 식 연산자 | $let |
|
|
|
창 연산자 | $sum |
|
|
|
$push |
|
|
| |
$addToSet |
|
|
| |
$count |
|
|
| |
$max |
|
|
| |
$min |
|
|
| |
$avg |
|
|
| |
$stdDevPop |
|
|
| |
$bottom |
|
|
| |
$bottomN |
|
|
| |
$covariancePop |
|
|
| |
$covarianceSamp |
|
|
| |
$denseRank |
|
|
| |
$derivative |
|
|
| |
$documentNumber |
|
|
| |
$expMovingAvg |
|
|
| |
$first |
|
|
| |
$integral |
|
|
| |
$last |
|
|
| |
$linearFill |
|
|
| |
$locf |
|
|
| |
$minN |
|
|
| |
$rank |
|
|
| |
$shift |
|
|
| |
$stdDevSamp |
|
|
| |
$top |
|
|
| |
$topN |
|
|
| |
조건식 연산자 | $cond |
|
|
|
$ifNull |
|
|
| |
$switch |
|
|
| |
집계 파이프라인 단계 | $addFields |
|
|
|
$bucket |
|
|
| |
$bucketAuto |
|
|
| |
$changeStream |
|
|
| |
$changeStreamSplitLargeEvent |
|
|
| |
$collStats |
|
|
| |
$count |
|
|
| |
$densify |
|
| ||
$documents |
|
| ||
$facet |
|
|
| |
$fill |
|
| ||
$geoNear |
|
|
| |
$graphLookup |
|
|
| |
$group |
|
|
| |
$indexStats |
|
|
| |
$limit |
|
|
| |
$listSampledQueries |
|
|
| |
$listSearchIndexes |
|
|
| |
$listSessions |
|
|
| |
$lookup |
|
|
| |
$match |
|
|
| |
$merge |
|
|
| |
$out |
|
|
| |
$planCacheStats |
|
|
| |
$project |
|
|
| |
$redact |
|
|
| |
$replaceRoot |
|
|
| |
$replaceWith |
|
|
| |
$sample |
|
|
| |
$search |
|
|
| |
$searchMeta |
|
|
| |
$set |
|
|
| |
$setWindowFields |
|
|
| |
$skip |
|
|
| |
$sort |
|
|
| |
$sortByCount |
|
|
| |
$unionWith |
|
|
| |
$unset |
|
|
| |
$unwind |
|
|
| |
$shardedDataDistribution |
|
|
| |
$currentOp |
|
|
| |
$listLocalSessions |
|
|
| |
집계 식의 변수 |
지금 |
|
|
|
ROOT |
|
|
| |
REMOVE |
|
|
| |
CURRENT |
|
|
| |
CLUSTER_TIME |
|
|
| |
DESCEND |
|
|
| |
PRUNE |
|
|
| |
KEEP |
|
|
| |
SEARCH_META |
|
|
| |
USER_ROLES |
|
|
|
참고 항목
*스키마 유효성 검사는 삽입, 업데이트, findAndModify 및 집계의 $merge/$out 단계를 지원합니다. bypassDocumentValidation을 사용하여 필요한 경우 유효성 검사를 건너뜁니다.
인덱스 및 인덱스 속성
Azure Cosmos DB for MongoDB vCore는 다음 인덱스 및 인덱스 속성을 지원합니다.
참고 항목
고유 인덱스를 만들면 빌드 프로세스의 전체 기간 동안 컬렉션에 대한 배타적 잠금이 생성됩니다. 이렇게 하면 작업이 완료될 때까지 컬렉션에 대한 읽기 및 쓰기 작업이 차단됩니다.
인덱스
명령 | 지원됨 |
단일 필드 인덱스 |
|
복합 인덱스 |
|
Multikey 인덱스 |
|
텍스트 인덱스 |
|
와일드카드 인덱스 |
|
지리 공간적 인덱스 |
|
해시된 인덱스 |
|
벡터 인덱스(Cosmos DB에서만 사용 가능) |
|
인덱스 속성
명령 | 지원됨 |
TTL (TTL) |
|
고유 |
|
부분 |
|
대/소문자 구분 안 함 |
|
스파스 |
|
배경 |
|