Updated on 2022-12-14 GMT+08:00

Details

This section describes the features and compatibility of DDS and MongoDB.

MongoDB Compatibility

Table 1 Compatible features

Category

Details

DDS 4.0

DDS 4.2

MongoDB 4.2 Community Edition

MongoDB 4.4 Community Edition

Database commands

The find command supports the allowDiskUse field, which allows MongoDB to use temporary files on disk to store data exceeding the system memory limit while processing a non-index sort operation.

×

×

×

Distributed transactions

Distributed transactions are supported. Distributed transactions refer to multi-document transactions on sharded clusters and replica sets. Multi-document transactions (whether on sharded clusters or replica sets) are also known as distributed transactions starting in MongoDB 4.2.

×

The 16 MB total size limit for a transaction was removed.

×

×

The MongoDB drivers must be updated for MongoDB 4.2.

×

Aggregation

  • The aggregation capability is improved. Data can be updated in the aggregation pipeline.
  • Added $merge.
  • Added $accumulator and $function.
  • Supported union All.
  • Added $unionWith.
  • For details about aggregation operations, see Table 2.

Wildcard indexes

Wildcard indexes are supported.

Sharded cluster

A document's shard key field value can be changed.

×

×

The fields associated with the shard key can be adjusted.

×

Collections can be sharded using a composite shard key that consists of a single hash field.

×

×

×

The 512-byte size limit on a shard key was removed.

×

×

×

Multi-document transactions allow the creation of indexes and collections (non-distributed transactions).

×

×

×

Indexes

The size limit on indexes was removed.

The length limit on index names was removed.

×

×

Composite indexes can contain hash indexes.

×

×

×

Hidden indexes are supported for commissioning.

×

The size limit on collection namespaces is changed.

The length of <database>.<collection> is increased from 120 bytes to 255 bytes.

×

×

×

√ indicates that an item is supported, and × indicates that an item is not supported.

Aggregation Operations

Table 2 Aggregation operations

Operator

DDS 4.0

DDS 4.2

MongoDB 4.2 Community Edition

MongoDB 4.4 Community Edition

$sin

$cos

$tan

$asin

$acos

$atan

$atan2

$asinh

$acosh

$atanh

$degreesToRadians

$radiansToDegrees

$round

$trunc

$regexFind

$regexFindAll

$regexMatch

$merge

$planCacheStats

×

×

$replaceWith

$set

$unset

NOW

CLUSTER_TIME

findAndModify

×

update

$accumulator

×

$binarySize

×

$bsonSize

×

$first

×

$function

×

$last

×

$isNumber

×

$replaceOne

×

$unionWith

×

√ indicates that an item is supported, and × indicates that an item is not supported.