Skip to content

Commit

Permalink
2.3.1 - converted a callbackified promise into a normal promise (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiren authored Aug 30, 2024
2 parents ff6474a + 503c025 commit ebda37c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions lib/Collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,13 @@ class Collection {
return callback(new Error('Invalid query object'));
}
try {
callbackify(() => {
return this.queryAsCursor(query, options).toArray();
})((err, results) => {
if (err) {
return callback(err);
}

this.queryAsCursor(query, options).toArray().then((results)=>{
if (!results) {
return callback(null, []);
}
return callback(null, results);
}, (err)=>{
return callback(err);
});
} catch (exp) {
return callback(exp);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@synatic/mongo-magic",
"version": "2.3.0",
"version": "2.3.1",
"description": "Synatic utility classes for interacting with MongoDB",
"main": "index.js",
"files": [
Expand Down

0 comments on commit ebda37c

Please sign in to comment.