Added a filtering function to handle badly index arrays in certain mongo conditionals

Signed-off-by: Josh Rodarte <josh@hipstercreative.com>