Skip to content

How to specify readConcern for find()? #47

@mondwan

Description

@mondwan

I am running a single mongodb.

However, I keep reading stale data from lua binding after nodejs complete the write operation. Therefore, I would like to specify read and write concern on both side to ensure no stale data.

in nodejs, I ensure the write concern by j and w.

    return this._db.collection('runtimeDataset').updateOne(
        {_id: cmd},
        updateContext,
        {j: true, w: 1}
    ).then(function () {
        return q.delay(1000);
    });

I have tried to wait for 10 seconds. It still reads the stale record.

But, I am not sure how to specify readConcern in this lua binding.

Or, are there any hints for not reading stale data?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions