Provide additional info about collection
This commit is contained in:
parent
08ad920a2c
commit
d11293dc94
|
@ -336,7 +336,7 @@ AbstractClass.all = function all(params, cb) {
|
|||
collection = data.map(function (d) {
|
||||
var obj = null;
|
||||
// do not create different instances for the same object
|
||||
var cached = getCached(constr, d.id);
|
||||
var cached = d && getCached(constr, d.id);
|
||||
if (cached) {
|
||||
obj = cached;
|
||||
// keep dirty attributes untouthed (remove from dataset)
|
||||
|
@ -350,6 +350,9 @@ AbstractClass.all = function all(params, cb) {
|
|||
}
|
||||
return obj;
|
||||
});
|
||||
if (data && data.countBeforeLimit) {
|
||||
collection.countBeforeLimit = data.countBeforeLimit;
|
||||
}
|
||||
cb(err, collection);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue