Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. diff --git a/test/functional/collection_tests.js b/test/functional/collection_tests.js
  2. index 44f28a552..64a3914dd 100644
  3. --- a/test/functional/collection_tests.js
  4. +++ b/test/functional/collection_tests.js
  5. @@ -1701,6 +1701,26 @@ describe('Collection', function() {
  6. });
  7. });
  8.  
  9. + it('should use arrayFilters for updateOne', function(done) {
  10. + const configuration = this.configuration;
  11. + const client = configuration.newClient({}, { w: 1 });
  12. +
  13. + client.connect(function(err, client) {
  14. + const db = client.db(configuration.db);
  15. + const collection = db.collection('arrayfilterstest');
  16. + const docs = [{ a: [ { x: 1 }, { x: 2 }] }, { a: [ { x: 3 }, { x: 4 }] }];
  17. + const close = e => client.close(() => done(e));
  18. +
  19. + collection.insertMany(docs).then(() =>
  20. + collection.updateMany({}, {}, { arrayFilters: [{ x: { $gte: 1 } }] } (err, data) => {
  21. + console.log(data);
  22. + expect(data).to.equal(1);
  23. + close(err);
  24. + })
  25. + );
  26. + });
  27. + });
  28. +
  29. describe('countDocuments with mock server', function() {
  30. let server;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement