DEV Community

Suhana
Suhana

Posted on

How to find latest document for all ids in the list of ids?

I have a database Book(id, author, createdAt, updatedAt) in mongodb. Now, I have list of authors and want to find their latest book of every author in the list.
Can anyone help me resolve this? Thanks in advance

Top comments (0)

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay