Linearizable
The query returns data that reflects all successful majority-acknowledged writes that completed prior to the start of the read operation. The query may wait for concurrently executing writes to propagate to a majority of replica set members before returning results.
Linearizable is not compatible with the stages $out
and $merge
.
Linearizable read concern only applies if read operations specify a query filter that uniquely identifies a single document. Additionally, if none of the following criteria are met, linearizable read concern might not read from a consistent snapshot, resulting in a document matching the filter not being returned.
Always add a maxTime option in case a majority cannot be elected (e.g. if two many replica set members have crashed) to avoid the read blocking forever.