What I would like to achieve is finding all records that match a pair of strings and sorted by a name tag. The data looks something like:
{
type:"user",
name:"Borrden",
description:"Supreme Ruler of the Codebase",
filters:[["department", "development"], ["location", "Internet"]]
}
{
type:"user",
name:"Skallagorm",
description:"NoSQL Noob",
filters:[["department", "development"], ["location", "London"], ["club", "Young Chelsea"]]
}
{
type:"user",
name:"James Piercey",
description:"Elusive",
filters:[["department", "design"], ["location", "Europe"]]
}
Filtering by [“department”, “development”] should return “Borrden” and “Skallagorm”. Filtering by [“department”, “development”] and [“location”, “London”] should return “Skallagorm”.
Can I achieve this with some combination of map, reduce and setting the keys on the query or do I have to do some sorting in filtering after receiving the result set from the query?
Thanks