@olaf

> It looks like you want to aggregate your data by "createdAt" at the first
> level.


no i just want to aggregate my my data by product name only

"outletId" seems to be not part of your document at your gist.


On Tue, Dec 14, 2021 at 6:10 PM Olaf Krüger <[email protected]> wrote:

> Hi,
>
> > please help me and guide me what i am doing wrong
>
> I just took a quick look into your gist:
> It looks like you want to aggregate your data by "createdAt" at the first
> level.
> If so, it might makes sense to start with the date within your key:
> emit(["createdAt", "outletId", "name"], ...)
>
> BTW 1:
> You might want to use "createdAt.substring(0,10)" in order to extraxt the
> date instead of invoking "Date()" a couple of times.
>
> BTW 2:
> "outletId" seems to be not part of your document at your gist.
>
> Maybe this helps,
> Olaf
>

Reply via email to