Wildcard Queries

I am trying to use the wildcard operator found here: https://docs.atlas.mongodb.com/reference/atlas-search/wildcard/ but whenever I try to run it, I get the following error:

MongoError: Unrecognized pipeline stage name: ‘$search’

My documents are like this:

{
  "_id": {
    "$oid": "609de83a3495584e98327521"
  },
  "email": "test.person@example.com",
  "name": "test middlename person",
  "ip": "192.168.0.1",
  "hash": "af1bd74f67760edbb1df27f8af09d4267a8d3309178c6b95523ec757fe1d81d6",
  "twitter": "",
  "facebook": "",
  "userid": "wef23f23fwefwwfhgeyukjykuyk"
}

I am trying to run the following wildcard query:

db.whatever.aggregate([
   {
     "$search": {
       "wildcard": {
         "path": "email",
         "query": "test.pe*"
       }
     }
   }
])

My mongodb is version 4.4.6 Community edition.

Please let me know why the query is not working.

Hi @Rohan_Patra,

Welcome to MongoDB community.

The relevant feature you pointed is only available in MongoDB Atlas cloud deployments.

You cannot use it on a local installation. Atlas offer a free tier and I suggest you try it out.

The local installation have text indexes and $text operators, those use other technology and are less capable though…

Thanks
Pavel

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.