But in case of sharded collections, how do you connect to the primary nodes
of all shards ??
In MongoDB 3.0.x, mongoexport will dump from each shard’s secondary nodes,
and this behavior cannot be changed.
However, in MongoDB 3.2.x, mongoexport using the --readPreference=primary
setting allows dumping from each shard’s primary. This is also the default
behavior of mongoexport in 3.2.x.
And by the way, what is the —slaveOk option for if it is a default option
and cannot be negated ?
This setting is a historical artifact, which is currently being deprecated
in MongoDB 3.2.x in favor of a more flexible --readPreference setting.
You may be able to use mongoexport version 3.2.x to dump data from MongoDB
version 3.0.x, so you can take advantage of the new --readPreference
setting. In my limited testing, it seems to work as expected. However
please be sure to test for your use case thoroughly, since you will be
mixing versions between the tool and the database engine.
You received this message because you are subscribed to the Google Groups "mongodb-user"