Comparing version 3.1.17 to 3.1.18
@@ -309,2 +309,19 @@ 'use strict'; | ||
* @memberOf ODM | ||
* @param {String} collection_name | ||
* @param {Object} options | ||
* @param {Function} callback | ||
*/ | ||
stats: function (collection_name, options, callback) { | ||
ODM.collection(collection_name, options, function (err, collection) { | ||
if (err) { | ||
return callback(err); | ||
} | ||
return collection.stats(options, callback); | ||
}); | ||
}, | ||
/** | ||
* @static | ||
* @memberOf ODM | ||
* | ||
@@ -311,0 +328,0 @@ * @param {String} collection_name |
@@ -313,2 +313,19 @@ /** | ||
/** | ||
* Get all the collection statistics. | ||
* | ||
* @static | ||
* @memberOf Model | ||
* @param {Object} [options] options for the query | ||
* @param {Function} callback Callback function (error, stats) with the result of the operation | ||
*/ | ||
Model.stats = function (options, callback) { | ||
if (callback === undefined) { | ||
callback = options; | ||
options = {}; | ||
} | ||
return odm.stats(mongoCollection, options, callback); | ||
}; | ||
/** | ||
* Finds all elements in this collection. | ||
@@ -315,0 +332,0 @@ * |
@@ -421,2 +421,11 @@ /** | ||
/** | ||
* @static | ||
* @memberOf BaseModel | ||
* @param {String} collection_name | ||
* @param {Object} options | ||
* @param {Function} callback | ||
*/ | ||
SchemaModel.stats = BaseModel.stats; | ||
/** | ||
* Loads documents referenced by id/ids. This is a helper function that calls internally find or findById | ||
@@ -423,0 +432,0 @@ * with the correct parameters. The order of the return is guaranteed, while with a find it is not. |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "3.1.17", | ||
"version": "3.1.18", | ||
"engines": { | ||
@@ -14,3 +14,3 @@ "node": ">=0.4.12" | ||
"dependencies": { | ||
"mongodb": "1.2.12", | ||
"mongodb": "1.2.14", | ||
"jsonschema": "0.3.2" | ||
@@ -17,0 +17,0 @@ }, |
96415
3160
+ Addedbson@0.1.8(transitive)
+ Addedmongodb@1.2.14(transitive)
- Removedbson@0.1.7(transitive)
- Removedmongodb@1.2.12(transitive)
Updatedmongodb@1.2.14