Skip to content

Commit

Permalink
feat: provide support for groupby
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Aaqil <[email protected]>
  • Loading branch information
aaqilniz committed Jan 14, 2024
1 parent ae3cf25 commit 352b803
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/dao.js
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,18 @@ DataAccessObject.find = function find(query, options, cb) {
delete obj.__data.__cachedRelations;
}
}

const keys = Object.keys(data);
keys.forEach(key => {
if (
key.includes('sumOf') ||
key.includes('countOf') ||
key.includes('avgOf') ||
key.includes('minOf') ||
key.includes('maxOf')
) {
obj.__data[key] = data[key];
}
});
callback(null, obj);
}

Expand Down

0 comments on commit 352b803

Please sign in to comment.