For questions about Amazon's DocumentDB with MongoDB compatible databases.
Questions tagged [aws-documentdb-mongoapi]
109 questions
2
votes
1 answer
Index fields not supported error while migrating MongoDB data to AWS DocumentDB
I am trying to migrate my data from MongoDB 3.6 running on one ec2 instance to AWS DocumentDB running on another ec2 instance by using mongodump and mongorestore commands.
But I am always getting at least one of following errors:
createIndex error:…

Dimpal Singh
- 157
- 12
2
votes
4 answers
AWS DocumentDb not support mongodb 4.0
I do not know why AWS DocumentDb does not support MongoDB version that above 3.6? Should I use mongo 3.6 or 4.0 above?

Eric Lou
- 159
- 3
- 8
2
votes
2 answers
Enable change streams for Amazon DocumentDB
I know we can use Mongo shell to enable(or disable) change streams for Amazon Document DB. Is it possible to enable the change streams from AWS Console or MongoDB Driver?

chvc
- 85
- 1
- 2
- 7
2
votes
2 answers
EC2 instance will not connect to DocumentDB in different AZ. Why?
I have set up a documentdb cluster in us-east-1. I am attempting to connect via an EC2 instance in us-west-1. I have set up connection peering with the VPC in us-west-1 having a CIDR of 172.31.0.0/16 and the VPC in us-east-1 having a CIDR of…

Mark Brown
- 914
- 1
- 11
- 26
2
votes
2 answers
Whats the alternative to $replaceRoot on mongoDB? $replaceRoot is incompatible with documentDB
The problem: I'm trying to make a query on MongoDB, but I'm using the DocumentDb from amazon, where some operations are no supported. I wanted to find an alternative to get the same result, if possible. Basically I want to change the root of the…

Nathan Barreto
- 365
- 2
- 21
2
votes
2 answers
Creating an index on a large embedded array in mongo
I have a document with an embedded array. The array is just a bunch of strings. I recently came across some performance issues, so I decided to create an index. But it won't allow me to because the "key is too large to index".
I'm using AWS…

blockhead
- 9,655
- 3
- 43
- 69
2
votes
1 answer
Aws document db doesnot use indexes in elemMatch operator in find queries?
I am using seperate indexes for an array field of the documents. While querying the documents elemMatch operator is being used. But when i try running the explain command it shows me that the index is not used.
I get the following result for explain…

Roohafza
- 79
- 1
- 7
2
votes
2 answers
Compatible Scala driver for Amazon DocumentDB
Do you know a Scala driver to MongoDB, which is also compatible to Amazon DocumentDB? In theory they all should be compatible, I am interested what works in practice. In particular, I plan to use reactivemongo.

Mikhail Golubtsov
- 6,285
- 3
- 29
- 36
2
votes
1 answer
Not able to connect to AWS documentDb from Lambda
I'm trying to connect to AWS documentDB from Lambda function but, not able to connect.
MongoClient.connect never calls the callback function connected.
TLS is off on documentDB Cluster. I'm able to connect via mongo shell.
Lambda & documentDB…

Atul Sharma
- 9,397
- 10
- 38
- 65
2
votes
1 answer
Mongoose implementation for Document Referenced Relationship in MongoDB
I need to make a aggregation query using document referenced relationship (not with embedded documents). I'm able to make that query using the mongo shell, but struggling with its equivalent implementation using mongoose.
I have tried the virtual…

rohanmehto2
- 910
- 1
- 7
- 19
2
votes
2 answers
DocumentDB simple query times out with code 11601
The following query works perfectly in mongodb 3.6
but in documentdb it throws an error.
db.house.count({'data.foo.d':/2019-05/})
connecting to: docdb.xxxxxxxxxxx.xxxxxx.int:27017/dbname
2019-06-04T20:39:14.339+0000 E QUERY [thread1] Error: count…

oshaiken
- 2,593
- 1
- 15
- 25
2
votes
1 answer
How to write a Join query in AWS DocumentDB
AWS DoucmentDB is not supporting the $lookup operator, how to write a Join Query in DocumentDB, is there any alternative of $lookup operator in DocumentDB?

Bhanwarlal Chaudhary
- 402
- 6
- 20
2
votes
1 answer
Mongodb db.collection.distinct() on aws documentdb doesn't use index
Transitioning to new AWS documentDB service. Currently, on Mongo 3.2. When I run db.collection.distinct("FIELD_NAME") it returns the results really quickly. I did a database dump to AWS document DB (Mongo 3.6 compatible) and this simple query just…

Bhavik Shah
- 315
- 1
- 2
- 7
1
vote
0 answers
Cannot Connect to DocumentDB elastic cluster with Compass
I have created an DocumentDB elastic cluster and I'm able to connect to it successfully from my local machine using mongosh once I figured out I needed to disable retryWrites.
I'd love to be able to connect to it from Compass or a similar…

darktrek
- 132
- 1
- 9
1
vote
1 answer
I am connect mongo atlas with this code, but cannot create the database when i send these data
const { MongoClient } = require("mongodb");
const url =
"mongodb+srv://user:password@cluster0.25pjvgx.mongodb.net/products_test?retryWrites=true&w=majority";
const createProduct = async (req, res, next) => {
const newProduct = {
…

Shuvo Roy
- 11
- 2