Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose array includes

// As favouriteFoods is a simple array of strings, 
// you can just query that field directly:

// favouriteFoods contains "sushi"
PersonModel.find({ favouriteFoods: "sushi" }, ...);
 
PREVIOUS NEXT
Tagged: #mongoose #array #includes
ADD COMMENT
Topic
Name
8+8 =