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) {
|
collection = data.map(function (d) {
|
||||||
var obj = null;
|
var obj = null;
|
||||||
// do not create different instances for the same object
|
// do not create different instances for the same object
|
||||||
var cached = getCached(constr, d.id);
|
var cached = d && getCached(constr, d.id);
|
||||||
if (cached) {
|
if (cached) {
|
||||||
obj = cached;
|
obj = cached;
|
||||||
// keep dirty attributes untouthed (remove from dataset)
|
// keep dirty attributes untouthed (remove from dataset)
|
||||||
|
@ -350,6 +350,9 @@ AbstractClass.all = function all(params, cb) {
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
});
|
});
|
||||||
|
if (data && data.countBeforeLimit) {
|
||||||
|
collection.countBeforeLimit = data.countBeforeLimit;
|
||||||
|
}
|
||||||
cb(err, collection);
|
cb(err, collection);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue