I have this document's structure:
{
Id: "id_value",
Elements:[
{
InnerId: "inner_id_value1",
Value: "apple"
},
{
InnerId: "inner_id_value2",
Value: "pear"
},
{
InnerId: "inner_id_value3",
Value: "banana"
}
]
}
What i need to do is create a query which receives in input an array (for example ["apple","banana","coconut"]
) and returns to me:
{
Id: "id_value",
Elements:[
{
InnerId: "inner_id_value1",
Value: "apple"
},
{
InnerId: "inner_id_value3",
Value: "banana"
}
]
}
Is it possible do it in Mongo with a single query?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…