Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify readConcern for find()? #47

Open
mondwan opened this issue Apr 25, 2016 · 2 comments
Open

How to specify readConcern for find()? #47

mondwan opened this issue Apr 25, 2016 · 2 comments

Comments

@mondwan
Copy link

mondwan commented Apr 25, 2016

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?

@pakozm
Copy link
Contributor

pakozm commented Apr 25, 2016

As far as I know, this binding doesn't implements write/read concerns... if you have more than one mongod instance, you can change your JS write increasing the argument of w:1, it would be better to use the same number as mongod instances you need to acknowledge. Currently I don't figure any other way to ensure write/read concerns using this binding. I will let this issue open for future implementation of read/write concerns.

@mondwan
Copy link
Author

mondwan commented Apr 25, 2016

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants