Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection.prototype.remove throws an error when trying to remove all records #1662

Closed
wants to merge 1 commit into from
Closed
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
34 changes: 34 additions & 0 deletions test/functional/promises_collection_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,40 @@ describe('Promises (Collection)', function() {
return setupDatabase(this.configuration);
});

it('Should not throw an error when executing Collection.prototype.remove', {
metadata: {
requires: {
promises: true,
node: '>0.8.0',
topology: ['single']
}
},

// The actual test we wish to run
test: function(done) {
var configuration = this.configuration;
var MongoClient = configuration.require.MongoClient;
var url = configuration.url();
url =
url.indexOf('?') !== -1
? f('%s&%s', url, 'maxPoolSize=100')
: f('%s?%s', url, 'maxPoolSize=100');

MongoClient.connect(url).then(function(client) {
test.equal(1, client.topology.connections().length);
var db = client.db(configuration.db);

db
.collection('remove')
.remove({})
.then(function() {
client.close();
done();
});
});
}
});

it('Should correctly execute Collection.prototype.insertOne', {
metadata: {
requires: {
Expand Down