Skip to content

MongoDb query return empty object

I’m trying to perform a simple .find() query on my mongodbAtlas, but the result of this query is an empty object. this is my server file: this is my routes file: this is how my document is populated: Answer I think you are missing the “await” keyword after const data….. as API data fet…

How to grouping array of data by its category in javascript

This is my data: How can I transform this data to grouping each pet according to its species and gender like like this: My code is: the result from my code is: I expect the final result is like the second array above. Does any one know how to do this better and explaining what I’m missing. Thanks!! Answ…