Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/test/functional/collection_tests.js b/test/functional/collection_tests.js
- index 44f28a552..64a3914dd 100644
- --- a/test/functional/collection_tests.js
- +++ b/test/functional/collection_tests.js
- @@ -1701,6 +1701,26 @@ describe('Collection', function() {
- });
- });
- + it('should use arrayFilters for updateOne', function(done) {
- + const configuration = this.configuration;
- + const client = configuration.newClient({}, { w: 1 });
- +
- + client.connect(function(err, client) {
- + const db = client.db(configuration.db);
- + const collection = db.collection('arrayfilterstest');
- + const docs = [{ a: [ { x: 1 }, { x: 2 }] }, { a: [ { x: 3 }, { x: 4 }] }];
- + const close = e => client.close(() => done(e));
- +
- + collection.insertMany(docs).then(() =>
- + collection.updateMany({}, {}, { arrayFilters: [{ x: { $gte: 1 } }] } (err, data) => {
- + console.log(data);
- + expect(data).to.equal(1);
- + close(err);
- + })
- + );
- + });
- + });
- +
- describe('countDocuments with mock server', function() {
- let server;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement