Docs Menu

Docs HomeDevelop ApplicationsMongoDB Drivers

Amazon DocumentDB Compatibility

On this page

  • Version Information
  • Compatibility
  • Support
Amazon DocumentDB logo

Amazon DocumentDB (with MongoDB compatibility) is a fast, reliable, and fully managed database service. Amazon DocumentDB makes it easy to set up, operate, and scale MongoDB-compatible databases in the cloud. With Amazon DocumentDB, you can run the same application code and use the same drivers and tools that you use with MongoDB.

Amazon DocumentDB supports MongoDB v4.0 and MongoDB v5.0. These versions don't support all the newer features and functionality in the versions of MongoDB available on MongoDB Atlas.

Tip

MongoDB Version History

To learn more about the features available in each version of MongoDB, see MongoDB Evolved - Version History.

As of November 2023, Amazon DocumentDB is about 34 percent compatible with the MongoDB API.

On Amazon DocumentDB, the following MongoDB features are available in a limited capacity or are not supported at all:

  • Features: Capped collections, map-reduce operations, GridFS, text indexes, partial indexes, case-insensitive indexes

  • Commands: collMod, createView, filemd5, reIndex, connPoolStats, dbHash, features, sharding commands (aside from enableSharding and shardCollection)

  • Query Operators: $expr, $text, $where, $meta, $box, $center, $centerSphere, $polygon, $near

  • Aggregation Operators: $accumulator, $count, $ceil, $exp, $floor, $ln, $log, $log10, $pow, $sqrt, $trunc, $round, $first, $last, $switch, $binarySize, $bsonSize, $dateFromParts, $dateToParts, $dateTrunc, $dateDiff, $setDifference, $anyElementTrue, $allElementsTrue, $ltrim, $rtrim, $trim, $regexFind, $regexFindAll, $regexMatch, $replaceOne, $replaceAll, $convert, $toBool, $toDate, $toDecimal, $toDouble, $toInt, $toLong, $toObjectId, $toString, $isNumber, $rand, $sampleRate, $getField

  • Aggregation Stages: $collStats, $facet, $bucket, $bucketAuto, $sortByCount, $listLocalSessions, $listSessions, $graphLookup

In addition, Amazon DocumentDB does not leverage indexes when you perform queries that contain any of the following operators:

  • $ne

  • $nin

  • $nor

  • $not

  • $exists

  • $elemMatch

To learn more about Amazon DocumentDB's compatibility with MongoDB v4.0 and MongoDB v5.0, see the following AWS documentation:

For the most current compatibility status between Amazon DocumentDB and MongoDB, see the Is Amazon DocumentDB Compatible with MongoDB Atlas? website.

MongoDB doesn't offer commercial support for Amazon DocumentDB. For help with this product, contact AWS Support.

← Other Document Database Compatibility