I want to do a wildcard search on the Whole collection, irrespective of the Columns or rows.
ID | Name | Subject | Expert |
---|---|---|---|
1 | John Hill | Science | Maths |
2 | Matt Jane | English | Spanish |
3 | Tom Hill | Maths | Chemistry |
1.
mongoose.connection.db.collection('CollectionName').find({"name":/Hil/}).toArray(function (err,data){});
I get both ID 1 and 3
I tried using the $text $search function after indexing the collection
2.
mongoose.connection.db.collection('CollectionName')find({$text:{$search:"Maths"}}).toArray(function (err,data){});
I get both ID 1 and 3
3.
mongoose.connection.db.collection('CollectionName')find({$text:{$search:/Mat/}}).toArray(function (err,data){});
The above doesn't work.
I want to perform a wildcard search on both the column and row something like .find("wildcard":"wildcard")
Is it possible to achieve the above ?