Read Concern - Linearisible only on the primary?

Hi

I am just starting with MongoDB so it might be basic question:

In docs: https://docs.mongodb.com/manual/reference/read-concern-linearizable/#mongodb-readconcern-readconcern.-linearizable-

we can find this info

"
You can specify linearizable read concern for read operations on the primary only.
"

but how I can specify that the data should be read from the primary? I thought that decision about selecting node to read the data is made automatically somehow by DB engine or I am wrong?

-Jacek

Hi @Jacek_Kowalski welcome to the community!

By default, official drivers read from the Primary. This setting is called read preference, and they are different from read concern (of which linearizable is an option).

Also if you’re starting out, I highly recommend you to check out the free courses available at MongoDB university. There are courses ranging from beginner to advanced there that may be useful to your journey.

Best regards,
Kevin

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.