All Products
Search
Document Center

ApsaraDB for MongoDB:Compatibility details of DynamoDB-compatible instances

Last Updated:Mar 28, 2026

ApsaraDB for MongoDB supports the DynamoDB protocol for sharded cluster instances running MongoDB 4.0. This page covers which DynamoDB operations, parameters, expressions, and data types are supported, along with behavioral differences you should know before migrating.

Important

DynamoDB-compatible sharded cluster instances are no longer available for purchase. To use sharded cluster instances, use the MongoDB protocol instead. For more information, see [Notice] End of sale for DynamoDB-compatible sharded cluster instances.

Usage notes

  • DynamoDB protocol support applies only to sharded cluster instances running MongoDB 4.0.

  • Existing sharded cluster instances can have their protocol type changed to DynamoDB.

  • Only Virtual Private Cloud (VPC) network type is supported. No authentication is required.

Unsupported features

The following DynamoDB features are not supported. If your application relies on any of these, plan for code changes before migrating.

Billing and throughput controls

BillingMode, ProvisionedThroughput, and related metrics (ReturnConsumedCapacity, ConsumedCapacity, ItemCollectionMetrics, ReturnItemCollectionMetrics) are not supported across all operations.

Table management

  • ListTables does not support pagination. ExclusiveStartTableName, Limit, and LastEvaluatedTableName are ignored. All tables are returned in one response, with no limit on the number of returned records.

  • UpdateTable does not support GlobalSecondaryIndexes UPDATE actions. Only CREATE and DELETE are supported.

  • Table-level features not supported: Tags, SSESpecification, ReplicaUpdates, BillingMode.

Item operations

The following parameters are not supported across item operations (PutItem, UpdateItem, GetItem, DeleteItem, BatchWriteItem, BatchGetItem):

  • ConditionalOperator and Expected (legacy condition syntax) — use ConditionExpression instead

  • AttributesToGet — use ProjectionExpression instead

  • ConsistentRead

  • AttributeUpdates (legacy update syntax) — use UpdateExpression instead

Query and Scan

  • KeyConditions, QueryFilter, and ScanFilter (legacy filter syntax) — use KeyConditionExpression and FilterExpression instead

  • Select parameter

  • ConditionalOperator and ConsistentRead

DynamoDB Streams

  • DescribeStream: Limit and ExclusiveStartShardId are not supported.

  • ListStreams: Limit and ExclusiveStartStreamArn are not supported.

TableDescription data structure

The TableDescription response object returned by CreateTable, UpdateTable, DescribeTable, and DeleteTable includes the following fields.

FieldSupported
GlobalSecondaryIndexesYes
ItemCountYes
KeySchemaYes
LatestStreamArnYes
LatestStreamLabelYes
LocalSecondaryIndexesYes
StreamSpecificationYes
TableNameYes
TableSizeBytesYes
TableStatusYes
ArchivalSummaryNo
AttributeDefinitionsNo
BillingModeSummaryNo
CreationDateTimeNo
GlobalTableVersionNo
ProvisionedThroughputNo
ReplicasNo
RestoreSummaryNo
SSEDescriptionNo
TableArnNo
TableIdNo

DynamoDB operations compatibility

Table operations

OperationParameterSupportedNotes
CreateTableAttributeDefinitions (required)Yes
KeySchema (required)Yes
TableName (required)YesCannot contain $; cannot start with system.; must be 1–100 characters
BillingMode (optional)No
GlobalSecondaryIndexes (optional)Yes
LocalSecondaryIndexes (optional)Yes
ProvisionedThroughput (optional)No
SSESpecification (optional)No
StreamSpecification (optional)YesStreamViewType supports KEYS_ONLY (partition keys only, sort keys not supported) and NEW_IMAGE
Tags (optional)No
Response: TableDescriptionYes
UpdateTableAttributeDefinitions (optional)Yes
BillingMode (optional)No
GlobalSecondaryIndexesUpdates (required)YesCREATE and DELETE supported; UPDATE not supported
ProvisionedThroughput (optional)No
ReplicaUpdates (optional)No
SSESpecification (optional)No
StreamSpecification (optional)YesSame StreamViewType constraints as CreateTable
TableName (required)Yes
Response: TableDescriptionYes
DescribeTableTableName (required)Yes
Response: TableYes
ListTablesExclusiveStartTableName (optional)NoPagination not supported; all tables returned; no limit on the number of returned records
Limit (optional)NoPagination not supported; all tables returned; no limit on the number of returned records
Response: LastEvaluatedTableNameNo
Response: TableNamesYes
DeleteTableTableName (required)Yes
Response: TableDescriptionYes

Item operations

OperationParameterSupportedNotes
PutItemItem (required)Yes
TableName (required)Yes
ConditionalOperator (optional)No
ConditionExpression (optional)YesSee Expression compatibility
Expected (optional)No
ExpressionAttributeNames (optional)YesSee Expression compatibility
ExpressionAttributeValues (optional)YesSee Expression compatibility
ReturnConsumedCapacity (optional)No
ReturnItemCollectionMetrics (optional)No
ReturnValues (optional)Yes
Response: AttributesYes
Response: ConsumedCapacityNo
Response: ItemCollectionMetricsNo
UpdateItemKey (required)Yes
TableName (required)Yes
AttributeUpdates (optional)No
ConditionalOperator (optional)No
ConditionExpression (optional)YesSee Expression compatibility
Expected (optional)No
ExpressionAttributeNames (optional)YesSee Expression compatibility
ExpressionAttributeValues (optional)YesSee Expression compatibility
ReturnConsumedCapacity (optional)No
ReturnItemCollectionMetrics (optional)No
ReturnValues (optional)Yes
UpdateExpression (optional)YesSee Expression compatibility
Response: AttributesYes
Response: ConsumedCapacityNo
Response: ItemCollectionMetricsNo
GetItemKey (required)Yes
TableName (required)Yes
AttributesToGet (optional)No
ConsistentRead (optional)No
ExpressionAttributeNames (optional)YesSee Expression compatibility
ProjectionExpression (optional)YesSee Expression compatibility
ReturnConsumedCapacity (optional)No
Response: ConsumedCapacityNo
Response: ItemYes
DeleteItemKey (required)Yes
TableName (required)Yes
ConditionalOperator (optional)No
ConditionExpression (optional)YesSee Expression compatibility
Expected (optional)No
ExpressionAttributeNames (optional)YesSee Expression compatibility
ExpressionAttributeValues (optional)YesSee Expression compatibility
ReturnConsumedCapacity (optional)No
ReturnItemCollectionMetrics (optional)No
ReturnValues (optional)Yes
Response: AttributesYes
Response: ConsumedCapacityNo
Response: ItemCollectionMetricsNo
BatchWriteItemRequestItems (required)Yes
ReturnConsumedCapacity (optional)No
ReturnItemCollectionMetrics (optional)No
Response: ConsumedCapacityNo
Response: ItemCollectionMetricsNo
Response: UnprocessedItemsYes
BatchGetItemRequestItems (required)YesAttributesToGet and ConsistentRead are not supported within Item
ReturnConsumedCapacity (optional)No
Response: ConsumedCapacityNo
Response: ResponsesYes
Response: UnprocessedKeysYes

Query and Scan operations

OperationParameterSupportedNotes
QueryTableName (required)Yes
AttributesToGet (optional)No
ConditionalOperator (optional)No
ConsistentRead (optional)No
ExclusiveStartKey (optional)Yes
ExpressionAttributeNames (optional)YesSee Expression compatibility
ExpressionAttributeValues (optional)YesSee Expression compatibility
FilterExpression (optional)YesSee Expression compatibility
IndexName (optional)Yes
KeyConditionExpression (optional)YesSee Expression compatibility
KeyConditions (optional)No
Limit (optional)Yes
ProjectionExpression (optional)YesSee Expression compatibility
QueryFilter (optional)No
ReturnConsumedCapacity (optional)No
ScanIndexForward (optional)Yes
Select (optional)No
Response: ConsumedCapacityNo
Response: CountYes
Response: ItemsYes
Response: LastEvaluatedKeyYes
Response: ScannedCountYes
ScanTableName (required)Yes
AttributesToGet (optional)No
ConditionalOperator (optional)No
ConsistentRead (optional)No
ExclusiveStartKey (optional)Yes
ExpressionAttributeNames (optional)YesSee Expression compatibility
ExpressionAttributeValues (optional)YesSee Expression compatibility
FilterExpression (optional)YesSee Expression compatibility
IndexName (optional)Yes
Limit (optional)Yes
ProjectionExpression (optional)YesSee Expression compatibility
ReturnConsumedCapacity (optional)No
ScanFilter (optional)No
Segment (optional)Yes
Select (optional)No
TotalSegments (optional)Yes
Response: ConsumedCapacityNo
Response: CountYes
Response: ItemsYes
Response: LastEvaluatedKeyYes
Response: ScannedCountYes

DynamoDB Streams compatibility

OperationParameterSupportedNotes
DescribeStreamStreamArn (required)Yes
Limit (optional)No
ExclusiveStartShardId (optional)No
Response: StreamDescriptionYesDiffers from Amazon DynamoDB in three ways: (1) StartingSequenceNumber is fixed to unknown; (2) EndingSequenceNumber is a timestamp; (3) ShardId is fixed to arn:alibaba:mongo-dynamodb@shard-only-1 because the instance has only one shard node
ListStreamsTableName (optional)Yes
Limit (optional)No
ExclusiveStartStreamArn (optional)No
Response: StreamsYesUp to one stream per table
GetShardIteratorStreamArn (required)Yes
ShardId (required)YesFixed to arn:alibaba:mongo-dynamodb@shard-only-1
ShardIteratorType (required)YesOnly LATEST and AFTER_SEQUENCE_NUMBER are supported
SequenceNumber (optional)YesValid only when ShardIteratorType is AFTER_SEQUENCE_NUMBER; value can be a 32-bit timestamp in seconds
Response: ShardIteratorYes
GetRecordsShardIterator (required)Yes
Limit (optional)YesWhen not specified, each page returns 101 entries (not 1 MB of data as in Amazon DynamoDB)
Response: RecordsYes

Compatibility details of expressions

Attribute names containing a period (.)

In Amazon DynamoDB, an attribute name containing . is treated as a scalar attribute when the expression attribute name maps to all elements in a document path, or as a nested attribute otherwise. In ApsaraDB for MongoDB, scalar attributes containing . cannot be processed in query or projection expressions.

Projection expressions

Only one-dimensional arrays are supported. When a projection expression references a single array element, all other fields are also returned.

Condition expressions

The DynamoDB condition expression syntax is supported with the following constraints:

condition-expression ::=
      operand comparator operand
    | operand BETWEEN operand AND operand
    | operand IN ( operand (',' operand (, ...) ))
    | function
    | condition AND condition
    | condition OR condition
    | NOT condition
    | ( condition )

comparator ::=
    =
    | <>
    | <
    | <=
    | >
    | >=

function ::=
    attribute_exists (path)
    | attribute_not_exists (path)
    | attribute_type (path, type)
    | begins_with (path, substr)
    | contains (path, operand)
    | size (path)

Constraints:

  • operand1 comparator operand2: operand1 must be a path; operand2 must be an expression attribute value.

  • operand1 BETWEEN operand2 AND operand3: operand1 must be a path; all other operands must be expression attribute values.

  • operand1 IN (operand2, ...): operand1 must be a path; all other operands must be expression attribute values.

  • size(path): path must be of the STRING type (for length) or SET/LIST type (for size). BINARY and MAP types are not supported.

Update expressions

The DynamoDB update expression syntax is supported with the following constraints:

update-expression ::=
    [ SET action [, action] ... ]
    [ REMOVE action [, action] ...]
    [ ADD action [, action] ... ]
    [ DELETE action [, action] ...]

set-action ::=
    path = value

value ::=
    operand
    | operand '+' operand
    | operand '-' operand

operand ::=
    path | function

function ::=
    if_not_exists (path, value)
    | list_append (list1, list2)

remove-action ::=
    path

add-action ::=
    path value

delete-action ::=
    path value

SET action constraints:

  • SET path = operand: operand cannot be a path.

  • SET path = operand1 + operand2 or SET path = operand1 - operand2: operand1 must be a path. Only field increment and decrement are supported.

  • SET path = if_not_exists(path, value): Both path references must be equal, and value must be an expression attribute value. Partial updates are not supported when multiple conditions are specified concurrently — all conditions must be met for the expression to execute.

  • SET path = list_append(list1, list2): One of list1 or list2 must equal path; the other must be an expression attribute value.

REMOVE action constraint:

When a list element is removed, null replaces it. The list size remains unchanged and remaining elements are not shifted.

Data type mappings

Amazon DynamoDB and ApsaraDB for MongoDB use different data types. The following table shows how DynamoDB types map to MongoDB types in DynamoDB-compatible instances.

DynamoDB typeMongoDB type
BBinary data
BOOLBoolean
BSArray (see note below)
LArray
MObject
NDouble
NSArray (see note below)
NULLNull
SString
SSArray (see note below)
In Amazon DynamoDB, binary sets (BS), number sets (NS), and string sets (SS) deduplicate values automatically — for example, inserting 1,2,2,3 into an NS results in 1,2,3. DynamoDB-compatible ApsaraDB for MongoDB instances do not support data deduplication for these types and store them as plain arrays. This behavior will be optimized in a future release.