Skip to content

Commit 352b803

Browse files
committed
feat: provide support for groupby
Signed-off-by: Muhammad Aaqil <[email protected]>
1 parent ae3cf25 commit 352b803

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/dao.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,18 @@ DataAccessObject.find = function find(query, options, cb) {
19291929
delete obj.__data.__cachedRelations;
19301930
}
19311931
}
1932-
1932+
const keys = Object.keys(data);
1933+
keys.forEach(key => {
1934+
if (
1935+
key.includes('sumOf') ||
1936+
key.includes('countOf') ||
1937+
key.includes('avgOf') ||
1938+
key.includes('minOf') ||
1939+
key.includes('maxOf')
1940+
) {
1941+
obj.__data[key] = data[key];
1942+
}
1943+
});
19331944
callback(null, obj);
19341945
}
19351946

0 commit comments

Comments
 (0)