Answer the question
In order to leave comments, you need to log in
How to implement the right query to find what you need?
Hello, I started writing some kind of system. In general, there is an array that is in the database, and you need to find exactly the schema where the user with a certain identifier is located.
{
objID: 1,
[...]
members: [
{ author: 101, rank: "какой либо ранг (он может быть рандомный)" },
[...]
]
}
<>.findOne({ objID: 1, members: { $in: { author: 101 } } });
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