Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Unexpeted results when using the "$contains" operator #205
Unless I'm misunderstanding the usage, the '$contains' operator does not seem to produce expected results.
In this example I add items all that have their "test" property set to various types, including some with a string that I want to search for:
After searching for items where the "test" property contains "zzz" I get the following result set:
That last two results seem reasonable since the value of foo "contains" the search string, but the rest don't make much sense to me.
changed the title from
Unexpeted results when using the "$contains" operator behaviour
Unexpeted results when using the "$contains" operator
Aug 6, 2015
My hope in using $contains in the first place was that it would allow me to search for values that were at times arrays containing the search term, so hopefully the fix preserves this functionality. In other words, the example would return the following:
I believe @KimSchneider added the implementation for those ops, so ideally he might fix this but i'm not sure if he is monitoring this. If not, I will take a look at it over the weekend to see if I can better understand what he was trying to do. Your expectation of behavior sounds reasonable.