mongodb-haskell / mongodb

MongoDB driver for Haskell
http://hackage.haskell.org/package/mongoDB
Apache License 2.0
170 stars 44 forks source link

repair single document upserts when using OP_MSG #142

Closed pierreMizrahi closed 1 year ago

pierreMizrahi commented 1 year ago

780df80cfc0781a21a2c1e397de26c00c8878488 introduces support for the OP_MSG protocol. Unfortunately, the upsert and multi options of the update command still use flagBits to communicate the options, whereas they must be provided directly into the command document, alongside the "q" and "v" fields.

This commit:

The test is not perfect as the upsert operation is inherently racy and this difficult to test. A comfortable threadDelay has been inserted as a workaround to accomodate for medium workloads.

pierreMizrahi commented 1 year ago

@VictorDenisov can you please consider this PR ?

VictorDenisov commented 1 year ago

Yep. Sorry. Forgot in the shuffle.