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:
-
New capabilities
-
Optimizations
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 |
|---|---|---|
|
|
Returns the BinData subtype |
Distinguish UUID from generic binary fields |
|
|
Generates a random ObjectId in a pipeline |
Assign IDs during |
|
|
Produces MD5, SHA-256, or XXH64 hashes |
Compute content fingerprints or partition keys server-side |
|
|
Converts between BSON and Extended JSON |
Parse JSON strings stored as text fields back into typed BSON |
Broader type conversions
-
$toStringnow handles objects, arrays, regular expressions, MaxKey, MinKey, and timestamps. -
$convertadds abaseparameter 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
DDL routing requirement
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 |
|---|---|
|
|
Current memory consumed by the operation |
|
|
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.
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 |
|---|---|
|
|
Caps total memory for pre-auth buffers |
|
|
Rate-limits message-size error responses |
|
|
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 |
|---|---|
|
|
Initial retry delay |
|
|
Maximum retry delay |
|
|
Maximum retry count |
|
|
Overload retry token pool size per shard |
|
|
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 |
|---|---|
|
|
Global timeout for the profiling lock |
|
|
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.
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 |
|
|
Index naming |
Time-series indexes can no longer be named |
|
timeField naming |
A |
Behavioral changes
|
Area |
Change |
Previous behavior |
|---|---|---|
|
Upsert error codes |
Upserts producing BSON objects > 16 MB return error code 10334 ( |
Returned 17419 or 17420 |
|
validate |
|
No 16 MB check; full validation enabled BSON conformance |
|
Date arithmetic |
|
Faster but less accurate |
|
Float parsing |
The full range of double-precision floats (including subnormals like |
Subnormals rejected |
|
$trim character cap |
The |
No cap |
|
$mergeObjects |
Can now be used inside |
Not supported |
|
TextOr memory |
The TextOr stage ( |
No cap |
|
explain on nonexistent DB |
|
Database created implicitly |
|
config.csrs.indexes |
The |
Present |
|
findShardsOnConfigTimeoutMS |
New parameter that limits query time on |
No timeout |