Commit graph

28 commits

Author SHA1 Message Date
Pierre Mizrahi
51358d13c4 mongo 6: fix issue on collections with '.'
Collection names are allowed to have a '.' in their name, db
names aren't (see
https://www.mongodb.com/docs/manual/reference/limits/#naming-restrictions)

This codes changes the logic to extract the collection
name form a FullConnecton string by stripping until the first
dot, and provides a test case.
2023-05-29 11:48:05 +02:00
Pierre Mizrahi
995087e9a0 repair single document upserts when using OP_MSG
780df80cfc 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:
 - introduces a test for a single-document upsert that, if isolated,
   succeeds against the reference MongoDB 3.6 container, but fails
   against an official 6.0 image.
 - provides a patch that sets the appropriate options.

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.
2023-02-13 14:05:56 +01:00
Diego Balseiro
c6a9ffcc63 Make findCommand tests run just for MongoDB 3.2 or superior 2020-07-31 13:50:33 -05:00
Diego Balseiro
0c7a62fc56 Add tests for findCommand 2020-07-29 19:18:36 -05:00
Victor Denisov
571fe47d82 Test for non multi update 2017-05-29 16:34:35 -07:00
Victor Denisov
9bd0dff6ee Add unit test for upserted 2017-05-29 16:11:25 -07:00
Victor Denisov
a1e19379f6 Add test and fix for updateMany nMatched and nModified 2017-05-29 12:58:39 -07:00
Victor Denisov
8dac250e10 Add test for correct delete count 2017-05-28 12:38:34 -07:00
Victor Denisov
173e90eb90 Don't run ...Many tests against mongo 2.4 2017-04-09 20:43:54 -07:00
Victor Denisov
80ebc6f756 Throw exception when insertAll encounters big doc
- insertAll should throw an exception if it encounters a document
too big for one message. However all other documents will be inserted.

- slightly edit docs
2017-04-09 20:43:54 -07:00
Victor Denisov
139a17248f Fix tests 2017-04-09 20:43:54 -07:00
Victor Denisov
6fe3cd982d Fix unit tests
updateMany and updateAll don't throw exceptions.
They return UpdateResult which reports errors.
2017-04-09 20:43:54 -07:00
Victor Denisov
a11d573ff1 Tests use env variable to find mongodb host 2017-04-09 10:20:10 -07:00
Victor Denisov
1dc7e21d1e Add tests for delete 2016-06-19 17:18:39 -07:00
Victor Denisov
8091afe4a0 Hide Internal module 2016-06-16 11:27:03 -07:00
Victor Denisov
d4b1c3a8ff Add tests for update operations 2016-06-14 23:27:17 -07:00
Victor Denisov
3a4ebcb23b Insert the list of documents into chunks 2016-05-29 23:14:04 -07:00
Victor Denisov
76ac212708 Add test for allCollections request 2016-05-21 13:32:04 -07:00
Victor Denisov
bbba3f37ea Add test for rest function 2015-09-29 22:42:22 -07:00
Victor Denisov
0038e4163c Add big test 2015-06-20 21:14:26 -07:00
Sean Leather
77cde91c61 Add aggregate test 2015-03-22 19:55:01 +02:00
Sean Leather
8cfcb3894a Refactor to reduce duplicate code 2015-03-21 19:46:08 +02:00
Greg Weber
91701962c3 fix ActionWith usage 2015-03-05 12:00:01 -08:00
Fujimura Daisuke
7354bf0ada Minor code format fix 2014-08-19 21:30:07 +08:00
Fujimura Daisuke
3dd594999a Rename fakeDB to db 2014-08-19 21:29:18 +08:00
Fujimura Daisuke
c6d6f8c71a Minor refactor
Use `shouldReturn`
2014-08-19 12:59:48 +08:00
Fujimura Daisuke
70e8cbc9c2 Add tests for insert operations 2014-08-19 12:59:48 +08:00
Fujimura Daisuke
f6d886e8bd Reorganize specs 2014-08-19 12:48:36 +08:00
Renamed from test/QueryTest.hs (Browse further)