I am using AWS document db v4.0.0. It works fine with my application using MongoDB driver to connect. But when I try to use mongo shell it gives me some errors on basic query:
db.myCollection.find({})
Error: error: {
"ok" : 0,
"code" : 303,
"errmsg" : "Feature not supported: 'causal consistency'",
"operationTime" : Timestamp(1645150705, 1)
}
Does this mean DocumentDB is not compatible with mongo shell?
CodePudding user response:
Your code is missing the actual connection part, but make sure you have the TLS keys placed on the machine.
Your connection string should be something like this:
mongo --ssl host docdb-2020-02-08-14-15-11. cluster.region.docdb.amazonaws.com:27107 --sslCAFile rds-combined-ca-bundle.pem --username demoUser --password
There is actually a really good example/explanation in the official AWS Documentation
CodePudding user response:
Casual consistency isn't supported in DocumentDB. From your mongo shell you can run "db.getMongo().setCausalConsistency(false)" then re-run your find operation.
https://docs.mongodb.com/manual/reference/method/Mongo.setCausalConsistency/