Tweak single MongoDB query so aggregate > lookup doesn't return all fields in lookup collection
$20 USD
Pago na entrega
I have a MongoDB query:
var queryLookup = {from:'fromCollection',localField:'field',foreignField:'otherField',as:'lookup_info'}
[login to view URL]({$match:queryObj},{$lookup:queryLookup},{$project:queryProject},{$sort:sortObj}).toArray(function(err,items){});
However, the lookup_info value is an array with the first element being the entire set of data fields from the 'fromCollection'. So 'lookup_info' looks like this:
lookup_info: [{'field1':'val','field2':'val','field3':'val','field4':'val'}]
and instead I want this (notice, no array):
lookup_info: {'field1':'val','field4':'val'}
ID do Projeto: #18245497
Sobre o projeto
1 freelancer está oferecendo em média $50 para esse trabalho
Hello, I would like to take this assignment. I am having 14 years of experience on web development, deployment and project management. Below are my core technical skills •ASP.Net /HTML/CSS/JavaScript/JQuery •C# Mais