In my MongoDB collection, I have documents that contain an object called alltags
, which is an array of strings. I know how to search for a specific string within these arrays using
collection.find({alltags:"searchstring"})
, but I'm unsure of how to search for an object that contains two strings.
For example, how can I execute the query
collection.find({alltags:"searchstring1", {alltags:"searchstring2"}})