Closed divjotarora closed 3 years ago
I'm looking into adding a test for this. Integration tests are likely not possible because drivers don't currently add checksums, but I might be able to add a unit test.
Looks good 👍
For the unit test, we could add the flag / checksum to the opmsg here? https://github.com/coinbase/mongobetween/blob/b72171f27d65d79dc77db06f4561978c2cb13d64/mongo/operations_test.go#L71-L80
@mdehoog Added a test in my most recent commit.
The 4.2 version of the
mongo
shell sets an optional checksum on OP_MSG wire messages. Per this section of the OP_MSG spec, a message will have thechecksumPresent
flag set and the last four bytes will be a uint32 checksum. This PR adds support to detect and parse these checksums so we can use a 4.2 shell to connect to mongobetween.