Articles → MONGODB → Exclusion Operator Of Text Search In Mongodb
Exclusion Operator Of Text Search In Mongodb
Purpose
Syntax
db.collection.find({
$text: {
$search: "[search query] – [wordToExclude]"
}
})
Example
db.authors.find({
$text: {
$search: "Mongodb -Action2"
}
})