Created
April 11, 2020 09:00
-
-
Save mugan86/23dbbe7a55d85ead82a6b119aed8604e to your computer and use it in GitHub Desktop.
Añadiré las consultas para hacer inner join con MongoDB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Obtener los nombres de los datos principales del producto, limitado a 5 y que sean plataforma PC | |
db.products_platforms.aggregate( [{ $lookup: { from: 'products', localField: 'product_id', foreignField: 'id', as: 'info_general' } }, {$match: {platform_id: '4'}}, { $project: { product_id: 0 } }, {$limit: 5}]).pretty() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment