mfrachet
mfrachet

Reputation: 8932

Query a reference field to get the object Mongodb

I need to access a full object by one of its refs:

How can I do this ?

Thanks for all

Upvotes: 0

Views: 458

Answers (1)

Newbie
Newbie

Reputation: 1531

You could fetch all USERS with particular UserTypeId use below query

db.user.find({"userType.id" : "<ID HERE>"});

Hope this could help you.

Upvotes: 1

Related Questions