Re: couch db top sold products by date and store id, grouping and filtering by multiple keys

2021-12-14 Thread Olaf Krüger
> no i just want to aggregate my my data by product name only You told us this within your gist: // if user selects 13 of december prod1. 28 times sold5614 dollar earns prod2. 1 times sold20 dollar earns That still sounds to me that you want to aggregate your data by date

Re: couch db top sold products by date and store id, grouping and filtering by multiple keys

2021-12-14 Thread Rizwan Chouhan
@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. i updated gist my document is very large i only write relevant part not whole

Re: couch db top sold products by date and store id, grouping and filtering by multiple keys

2021-12-14 Thread Rizwan Chouhan
@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 wrote: > Hi, > > > please help

Re: couch db top sold products by date and store id, grouping and filtering by multiple keys

2021-12-14 Thread Olaf Krüger
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