How can I perform a search in mongoose where a field (which is an array) contains something? How can I perform a search in mongoose where a field (which is an array) contains something? mongoose mongoose

How can I perform a search in mongoose where a field (which is an array) contains something?


MongoDB query syntax allows you to match an element array like that:

.find( { tags: 'tag1' } )

And, of course, it's working with Mongoose :)

Source: http://docs.mongodb.org/manual/tutorial/query-documents/#match-an-array-element