I have an an array of objects which contain an artist, a song title and some other data, for example:
var obj = {
artist: 'Of Monsters and Men',
title: 'Little Talks',
data: 'important thing'
}
var array = [<obj1>, <obj2>, <obj3>];
I have also a mongoDB collection with contain songs. I need to query this collection and return all the songs which have the artist AND the title contained in the previous array. I also need to access the data field of the matching object.
I used to loop in the array and perform a query for each objects but it consumes too much resources, as there can be hundreds/thousands of objects in the array. Is there a way to achieve it?