read concert就是在复制集模式或复制集分片的模式下指定对于查询来说什么样的数据返回
对于下面的语句可以使用readconcern选项
find command
aggregate command and the db.collection.aggregate() method
distinct command
count command
parallelCollectionScan command
geoNear command
geoSearch command
对于示例和各个选项值的适合场景,参考
https://docs.mongodb.com/manual/reference/read-concern/
write concern是在单独,复制集合分片的模式下,对于写操作需要什么样的确认级别。关于write concern的选项值参考官网
https://docs.mongodb.com/manual/reference/write-concern/
就是数据的安全级别,参考这篇文章
https://www.percona.com/blog/2016/07/14/mongodb-data-durability/
{w:“majority”, j:1}这个配置最安全。
数据不丢失的另外一片文章https://mongoing.com/archives/1723
mongodb是把数据的安全性与数据的隔离性都放在了客户端上了。不是放在服务端实现的。