From 352b80318bfd185c77e2000b8bcd4fad9743ce74 Mon Sep 17 00:00:00 2001 From: Muhammad Aaqil Date: Thu, 28 Dec 2023 08:49:33 +0500 Subject: [PATCH] feat: provide support for groupby Signed-off-by: Muhammad Aaqil --- lib/dao.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/dao.js b/lib/dao.js index f34ed8b32..4ae1030f2 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -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); }