Ultimo aggiornamento Nuova versione del Sito !
This commit is contained in:
28
docs/query_mongodb.js
Normal file
28
docs/query_mongodb.js
Normal file
@@ -0,0 +1,28 @@
|
||||
db.getCollection('users').aggregate([
|
||||
{ $match: { idapp: '7', username:'Emycapp' } },
|
||||
{
|
||||
$lookup: {
|
||||
from: "naves",
|
||||
as: "ingr",
|
||||
let: { ind_order: '$ind_order' },
|
||||
pipeline: [
|
||||
{
|
||||
$match: {
|
||||
$expr: {
|
||||
$and: [
|
||||
{ $eq: ['$ind_order', '$$ind_order'] },
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
$replaceRoot: { newRoot: { $mergeObjects: [{ $arrayElemAt: ["$ingr", 0] }, "$$ROOT"] } }
|
||||
},
|
||||
{
|
||||
$match: { made_gift: { $exists: true } }
|
||||
}
|
||||
|
||||
])
|
||||
Reference in New Issue
Block a user