Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Remove bluebird promises #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/Cursor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Promise from 'bluebird';
import {Readable} from 'readable-stream';
import _ from 'lodash';

Expand Down
1 change: 0 additions & 1 deletion lib/Database.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Promise from 'bluebird';
import mongodb from 'mongodb-core';
import parseConnectionString from 'parse-mongo-url';
import _ from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
],
"dependencies": {
"babel-runtime": "^5.5.5",
"bluebird": "^2.9.27",
"harmony-proxy": "0.0.2",
"lodash": "^3.9.3",
"mongodb-core": "^1.1.33",
Expand All @@ -30,6 +29,7 @@
},
"devDependencies": {
"babel": "^5.5.5",
"bluebird": "^2.9.27",
"chai": "^3.0.0",
"grunt": "^0.4.5",
"grunt-babel": "^5.0.1",
Expand Down
16 changes: 16 additions & 0 deletions test/Cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,21 @@ describe('Cursor', function () {
expect(result).to.be.an.instanceof(Array);
expect(result.length).to.equal(4);
});

it('should be able to handle lots of documents', async function () {
const docsToInsert = [], numDocs = 600;
for (let i = 0; i < numDocs; i++) {
docsToInsert[i] = {
i,
name: `Pokemon ID #${i}`
};
}
await collection.insert(docsToInsert);

let result = await collection.find().toArray();

expect(result).to.be.an.instanceof(Array);
expect(result.length).to.equal(numDocs);
});
});
});