i have document.
{
‘participants’ : [ { ‘name’ : ‘rooney’, ‘team’ : ‘red’ , ‘win’ : true },
{ ‘name’ : ‘beckham’, ‘team’ : ‘red’ , ‘win’ : true },
{ ‘name’ : ‘giggs’, ‘team’ : ‘red’ , ‘win’ : true},
{ ‘name’ : ‘lampard’, ‘team’ : ‘blue’ , ‘win’ : false},
{ ‘name’ : ‘drogba’, ‘team’ : ‘blue’ , ‘win’ : false},
{ ‘name’ : ‘bosingwa’, ‘team’ : ‘blue’ , ‘win’ : false}
]
}
like this document, there are many document.
i want to find,
two player is in participants,
they are in different team,
and a player win.
for example.
i want to find, there are giggs, Lampard,
and they are in different team,
and lampard win.
(a document which i show, dosent match to this query,
because lampard lose.)
i wonder is it possible? or effiecient with query find.
or i should use aggregation.
elemMatch, expr, cond…maybe they can be used. but i think, it is very difficult.
in MongoDB, other people how can solve this difficult problem.???
in python, pandas,
i can do. because they are program language.
make variable, use for or while sentence, i can do it.
but using MongoDB query, it is very difficult to solve this problem.