jsft-mongodb
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -162,2 +162,3 @@ 'use strict'; | ||
* @param {object} conditions Query conditions (mongodb query conditions) | ||
* @param {object} [options] Query options | ||
* @return {Promise} | ||
@@ -167,2 +168,3 @@ */ | ||
var conditions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
@@ -172,3 +174,3 @@ assertCollectionName(collectionName); | ||
return _Link2.default.getCollection(collectionName).findOne(conditions).then(function (doc) { | ||
return _Link2.default.getCollection(collectionName).findOne(conditions, options).then(function (doc) { | ||
return doc ? fromDocument(doc) : undefined; | ||
@@ -210,9 +212,12 @@ }); | ||
* @param {string} id Entity id | ||
* @param {object} [options] Query options | ||
* @return {Promise} | ||
*/ | ||
Collection.findById = function (collectionName, schema, id) { | ||
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
assertCollectionName(collectionName); | ||
assertSchema(schema); | ||
return _Link2.default.getCollection(collectionName).findOne({ _id: (0, _mongodb.ObjectId)(id) }).then(function (doc) { | ||
return _Link2.default.getCollection(collectionName).findOne({ _id: (0, _mongodb.ObjectId)(id) }, options).then(function (doc) { | ||
return doc ? fromDocument(doc) : undefined; | ||
@@ -219,0 +224,0 @@ }); |
{ | ||
"name": "jsft-mongodb", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Functional abstraction layer for mongodb-storage of objects with structures defined with json-schema", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51565
1073