I am getting this error while creating index for search query. I wanted to make autocmplete for my search engine but mongo db keeps on throwing this error.
Here is my code:
const tracks = db.collection("tracks")
await tracks.createIndex({
"info.title": "autocomplete",
artist: "autocomplete",
genre: "autocomplete",
sid: "autocomplete",
})
autocomplete
is a MongoDB Atlas Search feature.You need to create your index through the Atlas API or UI.
https://docs.atlas.mongodb.com/reference/atlas-search/create-index/