(I know that there is no $contains in mongodb, just explaining what I was expecting to find before knowing the solution)
http://stackoverflow.com/a/18148872/2177408
As favouriteFoods is a simple array of strings, you can just query that field directly:
PersonModel.find({ favouriteFoods:"sushi"},...);
But I'd also recommend making the string array explicit in your schema:
person ={
name :String,
favouriteFoods :[String]}
Don't mistake it. Even if it's a list of dict, you can still query it this way. Sample: PersonModel.find({ favouriteFoods.text: "sushi" }, ...); person = { name : String, favouriteFoods : [{text:String}] }
Find document with array that contains a specific value
If I have this schema...person = { name : String, favoriteFoods : Array}... where the favoriteFood array is populated with strings. How can I find all persons that have "sushi" as the