I am trying to use mongorestore to move a database to DocumentDB. From the exact same EC2 instance, I run the same mongorestore command from 4.0 and 4.2. The 4.0 run errors based on the dump being in 4.2. When I use the same exact call with the 4.2 shell command, it throws the following error:
error connecting to host: could not connect to server: server selection error: server selection timeout, current topology: { Type: Single, Servers: … Last error: connection() : x509: certificate signed by unknown authority }, ] }
DocumentDB is not a MongoDB product but rather a re-implementation of an old MongoDB version with notable differences with the genuine MongoDB of similar version. Please see their documentation for more on this subject.
Thus using any MongoDB official tools on it is not supported. Even if mongorestore works, I would be suspicious if it doesn’t complain about something, as there are too many differences between it and a genuine MongoDB server.
If you need a cloud-hosted database and you’re not locked into a DocumentDB solution, I would encourage you to have a look at MongoDB Atlas, as this is created and supported by MongoDB. You would be able to use the official tools that you’re familiar with