I have two Mongo schemas:
User:
{
_id: ObjectId,
name: String,
country: ObjectId // Reference to schema Country
}
Country:
{
_id: ObjectId,
name: String
}
I want to get all users who have the country name "VietNam".
What kind of query (only to the User schema) can I use for this case?
I want it to look like this SQL query:
SELECT *
FROM User
JOIN Country
ON User.country = Country._id
WHERE Country.name = 'VietNam'