Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to search the matched elements in array of mongo database

db.inventory.find( { tags: {$all: ["red", "blank"] } } )// to search even if other elements exist in the array
db.inventory.find( { tags: ["red", "blank"]  } )// to search only if other elements does not exist in the array
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #search #matched #elements #array #mongo #database
ADD COMMENT
Topic
Name
6+8 =