How to specify a read concern?

I am using:

rc = db.comments.read_concern.ReadConcern("majority")
comments = db.comments.with_options(read_concern=rc)

It does not work.

@harriettxing

We have already imported ReadConcern on the top of code. As such, we can use it directly as we use WriteConcern.

comments = db.comments.with_options(read_concern=ReadConcern("majority"))

2 Likes