My proposal is that we add a new findContaining command, which behaves like findAll but on a multi-index.
So if you have a document {foo: 'a', bar: ['b', 'c']}, you could look it up with any of these commands
.findAll(foo: 'a')
.findAll(bar: ['b', 'c'])
.findContaining(bar: 'b')
I ran into the need for this while working on the web backend for Horizon cloud (@mglukhovsky is using Horizon to write the web interface), where every project has a set of users allowed to push to it, and we need to be able to look up all the projects a user is allowed to push to.
I'm not sure where this should go scheduling-wise, but I think it's pretty important. If we could get it in before we ship Horizon cloud that would save us some really ugly hacks, but I realize that's difficult.
My proposal is that we add a new
findContainingcommand, which behaves likefindAllbut on a multi-index.So if you have a document
{foo: 'a', bar: ['b', 'c']}, you could look it up with any of these commandsI ran into the need for this while working on the web backend for Horizon cloud (@mglukhovsky is using Horizon to write the web interface), where every project has a set of users allowed to push to it, and we need to be able to look up all the projects a user is allowed to push to.
I'm not sure where this should go scheduling-wise, but I think it's pretty important. If we could get it in before we ship Horizon cloud that would save us some really ugly hacks, but I realize that's difficult.