So when I have this code:
const search = Profile.find().populate("user", ["name", "picture"]);
console.log("quries", queries);
Object.keys(queries).forEach(key => {
// Apply a filter to the search for each key-value pair of the query Object
// This alters the search variable
console.log("key", key);
search.where(key, queries[key]);
});
I get this from my two console.logs:
quries {“location”:“Split”}
[0] key 0 [0] key 1 [0] key 2 up to [0] key 19
Why do i have so many keys?
Before when I had filtering I would have only one key and it would be equal to location for this example.