Answer the question
In order to leave comments, you need to log in
[Mongoose] How to find a user inside a schema?
Hello.
I have a "room" model in which there are 2 users - creator and player2
, the scheme looks something like this:
_id: *ид комнаты*
creator:
_id: *ид создателя*
login: "Вася"
select: none
player2:
_id: *ид второго игрока*
login: "Петя"
select: none
session.user._id
, but how can I search inside the schema? let room = await Room.findById(*ид*)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question