All Products
Search
Document Center

ApsaraDB for MongoDB:Features of MongoDB 8.3

Last Updated:Sep 10, 2026

ApsaraDB for MongoDB 8.3 introduces granular shard removal commands, in-progress slow query logging, per-operation memory tracking, and new aggregation expressions.

For the community changelog, see MongoDB 8.3 release notes.

Overview

ApsaraDB for MongoDB 8.3 includes the following changes:

For the complete community changelog, see MongoDB 8.3 release notes.

Aggregation enhancements

Array index access

$map, $filter, and $reduce now expose the current element's index. Bind it to a variable with arrayIndexAs, or use the built-in $$IDX.

// Add a 1-based "rank" field to each element
db.scores.aggregate([
  { $project: {
      ranked: { $map: {
        input: "$items",
        as: "item",
        arrayIndexAs: "i",
        in: { value: "$$item", rank: { $add: ["$$i", 1] } }
      }}
  }}
])

New expressions

Expression

Purpose

Example use case

$subtype

Returns the BinData subtype

Distinguish UUID from generic binary fields

$createObjectId

Generates a random ObjectId in a pipeline

Assign IDs during $merge or $out without a client round-trip

$hash / $hexHash

Produces MD5, SHA-256, or XXH64 hashes

Compute content fingerprints or partition keys server-side

$serializeEJSON / $deserializeEJSON

Converts between BSON and Extended JSON

Parse JSON strings stored as text fields back into typed BSON

Broader type conversions

  • $toString now handles objects, arrays, regular expressions, MaxKey, MinKey, and timestamps.

  • $convert adds a base parameter for base-2, -8, -10, and -16 string/number conversions.

  • New $toArray (string-to-array, binData-to-numeric-array) and $toObject (string-to-object) conversions. See Convert binData to Array.

Shard management overhaul

Granular shard removal

removeShard is deprecated. Four new commands break shard removal into discrete, reversible stages:

Stage

Command

Description

Start

startShardDraining

Begins migrating chunks off the target shard

Pause

stopShardDraining

Halts migration; the shard remains in the cluster

Monitor

shardDrainingStatus

Returns migration progress and remaining chunk count

Commit

commitShardRemoval

Finalizes removal after draining completes

You can pause and resume draining at any time -- useful during maintenance windows or unexpected load spikes.

DDL routing requirement

DDL operations and applyOps must now go through mongos. Running them directly on a shard node is no longer allowed. This prevents metadata inconsistencies in sharded clusters.

Monitoring and diagnostics enhancements

In-progress slow query logging

Slow queries are now logged while still running, not only after completion. Each query is logged once when it exceeds the threshold.

Set the threshold with --defaultSlowInProgMS at startup, or at runtime:

db.setProfilingLevel(1, { slowms: 100, slowinprogms: 3000 })

Each log entry includes an originalQueryShapeHash that links the shard-level log back to the original request on mongos.

Per-operation memory tracking

Two new fields appear in $currentOp, db.currentOp(), the profiler, slow query logs, explain output, and PlanCache.list():

Field

Description

inUseTrackedMemBytes

Current memory consumed by the operation

peakTrackedMemBytes

Peak memory consumed by the operation

Use these fields to identify memory-heavy queries and set informed limits.

queryStats on shard servers

When queryStats is enabled, shard servers now include queries forwarded from mongos. In earlier versions, these queries were invisible at the shard level.

Selective serverStatus output

New metrics cover aggregation extensions, shard critical sections, TTL operations, vector search, replication oplog fetcher latency, and execution queue admission.

Use the new none: 1 flag to suppress all optional sections and opt in selectively:

db.runCommand({ serverStatus: 1, none: 1, locks: 1 })

Use lockContentionMetrics: 1 to include lock-contention data on demand.

Note

The service field has been removed from serverStatus output.

FTDC retention increase

The default FTDC diagnostic directory cap grows from 200 MB to 500 MB. connPoolStats is now collected for mongod.

Performance and system parameters

Pre-authentication resource caps

Three new parameters limit resources consumed by unauthenticated connections:

Parameter

Purpose

capMemoryConsumptionForPreAuthBuffers

Caps total memory for pre-auth buffers

messageSizeErrorRateSec

Rate-limits message-size error responses

preAuthMaximumMessageSizeBytes

Limits maximum message body before authentication

These settings protect instances from resource exhaustion caused by connection-flooding attacks.

Automatic cache pressure recovery

cachePressureQueryPeriodMilliseconds controls how often the storage engine checks cache pressure. When pressure is detected, the oldest transactions are automatically aborted to free cache.

Overload-aware server selection

When overloadAwareServerSelectionEnabled is on, a client that receives SystemOverloadedError automatically retries against a different node.

Five parameters fine-tune retry backoff for internal mongos-to-mongod connections:

Parameter

Controls

defaultClientBaseBackoffMillis

Initial retry delay

defaultClientMaxBackoffMillis

Maximum retry delay

defaultClientRetryAttempts

Maximum retry count

shardRetryTokenBucketCapacity

Overload retry token pool size per shard

shardRetryTokenReturnRate

Token return rate on successful requests

Ingress rate-limit exemptions

ingressRequestRateLimiterApplicationExemptions exempts specific applications (by appName) from ingress rate limits. Set the app name in the connection string:

mongodb://server:27017/db?appname=mongodump

Profiler impact control

Two parameters prevent the profiler from degrading production performance:

Parameter

Purpose

internalQueryGlobalProfilingLockDeadlineMs

Global timeout for the profiling lock

internalProfilingMaxAbandonedWritesPerSecondPerDb

Cap on abandoned profiler writes per database per second

Monitor profiler overhead with profiler.totalAbandonedWrites and profiler.dbsPastThreshold in serverStatus.

Index changes

2dsphere default version upgrade

The default 2dsphereVersion moves from 3 to 4.

Important

Before you downgrade FCV below 8.3, drop all version-4 2dsphere indexes first.

GeoJSON priority in index generation

When a document contains both GeoJSON and legacy numeric coordinates, index generation now prefers GeoJSON. If you rely on legacy coordinates in existing indexes, rebuild those indexes after upgrading.

Time series changes

Change

Detail

Shard key constraint

refineCollectionShardKey on time-series collections now requires the shard key to reference logical metadata and time fields. Bucket-format keys are no longer accepted.

Index naming

Time-series indexes can no longer be named _id_, and _id_ cannot be used as a hint.

timeField naming

A timeField name can no longer start with $.

Behavioral changes

Area

Change

Previous behavior

Upsert error codes

Upserts producing BSON objects > 16 MB return error code 10334 (BSONObjectTooLarge)

Returned 17419 or 17420

validate

validate checks for documents exceeding 16 MB. validate(full=true) no longer enables checkBSONConformance automatically.

No 16 MB check; full validation enabled BSON conformance

Date arithmetic

$dateAdd / $dateSubtract with non-millisecond units and pre-epoch dates may return results one second slower

Faster but less accurate

Float parsing

The full range of double-precision floats (including subnormals like 7.08263e-317) can now be parsed

Subnormals rejected

$trim character cap

The chars argument of $trim, $ltrim, and $rtrim is capped at 4,096 characters

No cap

$mergeObjects

Can now be used inside $setWindowFields

Not supported

TextOr memory

The TextOr stage ($text scoring) is capped at 100 MB; spills to disk when allowDiskUse is true

No cap

explain on nonexistent DB

explain() on a nonexistent database in a sharded cluster no longer creates the database implicitly

Database created implicitly

config.csrs.indexes

The config.csrs.indexes system collection has been removed

Present

findShardsOnConfigTimeoutMS

New parameter that limits query time on config.shards

No timeout