Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getUser = async (query) => {
- const user = await Users.findOne(query);
- const feed = await Feeds.findOne({ user: user._id });
- return { user, feed };
- };
- // getUser will return a promise
- getUser({ username: 'test' }).then(...);
Add Comment
Please, Sign In to add comment