loopback-connector-mongodb
Advanced tools
Comparing version
@@ -1,25 +0,18 @@ | ||
### Description | ||
<!-- | ||
Please provide a high-level description of the changes made by your pull request. | ||
Include references to all related GitHub issues and other pull requests, for example: | ||
#### Related issues | ||
<!-- | ||
Please use the following link syntaxes: | ||
- connect to #49 (to reference issues in the current repository) | ||
- connect to strongloop/loopback#49 (to reference issues in another repository) | ||
Fixes #123 | ||
Implements #254 | ||
See also #23 | ||
--> | ||
- connect to <link_to_referenced_issue> | ||
## Checklist | ||
### Checklist | ||
👉 [Read and sign the CLA (Contributor License Agreement)](https://cla.strongloop.com/agreements/strongloop/loopback-connector-mongodb) 👈 | ||
<!-- | ||
- Please mark your choice with an "x" (i.e. [x], see | ||
https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments) | ||
- PR's without test coverage will be closed. | ||
--> | ||
- [ ] `npm test` passes on your machine | ||
- [ ] New tests added or existing tests modified to cover all changes | ||
- [ ] Code conforms with the [style | ||
guide](http://loopback.io/doc/en/contrib/style-guide.html) | ||
- [ ] Code conforms with the [style guide](https://loopback.io/doc/en/contrib/style-guide-es6.html) | ||
- [ ] Commit messages are following our [guidelines](https://loopback.io/doc/en/contrib/git-commit-messages.html) |
@@ -0,1 +1,13 @@ | ||
2019-11-22, Version 5.2.1 | ||
========================= | ||
* fix creation of LB4 models with auto-generated id (Miroslav Bajtoš) | ||
* chore: improve issue and PR templates (Nora) | ||
* feat: update dependenies (Francois) | ||
* feat: upgrade to eslint v6 (Francois) | ||
2019-10-25, Version 5.2.0 | ||
@@ -2,0 +14,0 @@ ========================= |
@@ -50,3 +50,3 @@ // Copyright IBM Corp. 2013,2019. All Rights Reserved. | ||
err, | ||
customers | ||
customers, | ||
) { | ||
@@ -58,3 +58,3 @@ g.log('{{Customers}} matched by {{emails.email}} %s', customers); | ||
err, | ||
customers | ||
customers, | ||
) { | ||
@@ -85,6 +85,6 @@ g.log('{{Customers}} matched by {{emails.0.label}} %s', customers); | ||
}); | ||
} | ||
}, | ||
); | ||
} | ||
}, | ||
); | ||
}); |
@@ -58,3 +58,3 @@ // Copyright IBM Corp. 2015,2019. All Rights Reserved. | ||
], | ||
done | ||
done, | ||
); | ||
@@ -90,3 +90,3 @@ }); | ||
], | ||
done | ||
done, | ||
); | ||
@@ -93,0 +93,0 @@ }); |
@@ -43,3 +43,3 @@ // Copyright IBM Corp. 2012,2019. All Rights Reserved. | ||
if (ObjectIdValueRegex.test(id)) { | ||
return bson.ObjectID(id); | ||
return new bson.ObjectID(id); | ||
} else { | ||
@@ -314,3 +314,3 @@ return id; | ||
self.settings.url, | ||
err | ||
err, | ||
); | ||
@@ -323,3 +323,3 @@ } | ||
err, | ||
client | ||
client, | ||
) { | ||
@@ -342,3 +342,3 @@ if (err) { | ||
url.dbName || self.settings.database, | ||
url.db_options || self.settings | ||
url.db_options || self.settings, | ||
); | ||
@@ -493,3 +493,3 @@ if (callback) callback(err, self.db); | ||
command, | ||
err | ||
err, | ||
); | ||
@@ -540,3 +540,3 @@ } | ||
}, | ||
callback | ||
callback, | ||
); | ||
@@ -605,3 +605,9 @@ } | ||
idValue = result.ops[0]._id; | ||
idValue = self.coerceId(modelName, idValue, options); | ||
try { | ||
idValue = self.coerceId(modelName, idValue, options); | ||
} catch (err) { | ||
return callback(err); | ||
} | ||
// Wrap it to process.nextTick as delete data._id seems to be interferring | ||
@@ -807,3 +813,3 @@ // with mongo insert | ||
options, | ||
callback | ||
callback, | ||
) { | ||
@@ -863,3 +869,3 @@ const self = this; | ||
} | ||
} | ||
}, | ||
); | ||
@@ -1124,3 +1130,3 @@ }; | ||
unit + | ||
", fallback to mongodb default unit 'meters'" | ||
", fallback to mongodb default unit 'meters'", | ||
); | ||
@@ -1403,3 +1409,3 @@ return distance; | ||
options, | ||
callback | ||
callback, | ||
); | ||
@@ -1423,3 +1429,3 @@ } else { | ||
options, | ||
callback | ||
callback, | ||
) { | ||
@@ -1488,3 +1494,3 @@ const self = this; | ||
err, | ||
data | ||
data, | ||
) { | ||
@@ -1517,3 +1523,3 @@ cb(err, data); | ||
err, | ||
info | ||
info, | ||
) { | ||
@@ -1559,3 +1565,3 @@ debug('updateWithOptions.callback', modelName, {_id: id}, data, err, info); | ||
options, | ||
cb | ||
cb, | ||
) { | ||
@@ -1611,3 +1617,3 @@ const self = this; | ||
} | ||
} | ||
}, | ||
); | ||
@@ -1635,3 +1641,3 @@ }; | ||
options, | ||
cb | ||
cb, | ||
) { | ||
@@ -1670,3 +1676,3 @@ const self = this; | ||
} | ||
} | ||
}, | ||
); | ||
@@ -1822,9 +1828,9 @@ }; | ||
index.options, | ||
indexCallback | ||
indexCallback, | ||
); | ||
}, | ||
modelCallback | ||
modelCallback, | ||
); | ||
}, | ||
cb | ||
cb, | ||
); | ||
@@ -1876,3 +1882,3 @@ } else { | ||
modelName, | ||
err | ||
err, | ||
); | ||
@@ -1902,3 +1908,3 @@ if ( | ||
self.autoupdate(models, cb); | ||
} | ||
}, | ||
); | ||
@@ -1987,3 +1993,3 @@ } else { | ||
else return !isStrictObjectIDCoercionEnabled(modelCtor, options); | ||
} else if (value instanceof ObjectID) { | ||
} else if (value instanceof mongodb.ObjectID) { | ||
return true; | ||
@@ -2089,3 +2095,3 @@ } else { | ||
err, | ||
data | ||
data, | ||
) { | ||
@@ -2097,3 +2103,3 @@ callback(err, data[0], created); | ||
} | ||
} | ||
}, | ||
); | ||
@@ -2100,0 +2106,0 @@ } |
@@ -10,3 +10,3 @@ // Copyright IBM Corp. 2014,2019. All Rights Reserved. | ||
point1, | ||
point2 | ||
point2, | ||
) { | ||
@@ -24,5 +24,4 @@ const R = 6371; // Radius of the earth in km | ||
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); | ||
const d = R * c; // Distance in km | ||
return d; | ||
return R * c; // Distance in km; | ||
}; | ||
@@ -29,0 +28,0 @@ |
{ | ||
"name": "loopback-connector-mongodb", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"description": "The official MongoDB connector for the LoopBack framework.", | ||
@@ -31,5 +31,5 @@ "engines": { | ||
"dependencies": { | ||
"async": "^2.6.1", | ||
"async": "^3.1.0", | ||
"bson": "^1.0.6", | ||
"debug": "^3.1.0", | ||
"debug": "^4.1.0", | ||
"loopback-connector": "^4.5.0", | ||
@@ -43,3 +43,3 @@ "mongodb": "^3.2.4", | ||
"coveralls": "^3.0.4", | ||
"eslint": "^5.1.0", | ||
"eslint": "^6.6.0", | ||
"eslint-config-loopback": "^13.0.0", | ||
@@ -49,8 +49,8 @@ "juggler-v3": "file:./deps/juggler-v3", | ||
"loopback-datasource-juggler": "^3.0.0 || ^4.0.0", | ||
"mocha": "^5.2.0", | ||
"mocha": "^6.2.0", | ||
"nyc": "^14.1.1", | ||
"rc": "^1.2.8", | ||
"semver": "^5.5.1", | ||
"semver": "^6.3.0", | ||
"should": "^13.2.1", | ||
"sinon": "^6.1.3" | ||
"sinon": "^7.5.0" | ||
}, | ||
@@ -57,0 +57,0 @@ "ci": { |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
286450
123.1%57
23.91%6925
179.68%17
88.89%- Removed
- Removed
Updated
Updated