3

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?

Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523

2 Answers2

0

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

ThomasVdBerge
  • 7,483
  • 4
  • 44
  • 62
0

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/

allco
  • 1