How to get users' emails from Atlas App Service function code

Hi all,

We have a function that sends email notifications to users who subscribe to a specific event.
The user list is stored in our Atlas MongoDB and, for security reasons, we only store the userId’s, not the user emails.
From the function code, is there a way to query the Atlas App Service users by ID so we can retrieve the user’s email to send the email notification?

We tried to use the context.user but it only returns the authenticated user that initiated the request.

Thanks in advance!
Pablo