Hey guys, I need some help with the response payload and array in the documentMy first question: How can I do "array in the document", I tried too much but didn't achieve that.My second question:I've got a request payload like: (In here minCount and maxCount for filtering the data. Sum of the "count" array in the documents should be between "minCount" and "maxCount".startDate: {type: Date,//required: true },endDate: {type: Date,//required: true },minCount: {type: Number,//required: true },maxCount: {type: Number,//required: true }and I have to response payload like the sample like that:{ "code":0, "msg":"Success", "records":[{ "key":"TAKwGc6Jr4i8Z487", "createdAt":"2017-01-28T01:22:14.398Z", "totalCount":2800 }, { "key":"NAeQ8eX7e5TEg7oH", "createdAt":"2017-01-27T08:19:14.135Z", "totalCount":2900 }] } How can I do this response payload with my request payload? Note that: "code" for success your code is and it gives 0 if your code is success, "msg" is description of the success and "records" includes 3 items of "key", "createdAt" and "totalCount" which is the sum of "counts" array in the document.Thanks!
Submitted June 13, 2020 at 08:28AM by orcandos
No comments:
Post a Comment