I’m trying to create a search index on a view. I followed the steps on this page: Use MongoDB Views to Transform Documents and Filter Collections for Atlas Vector Search - Atlas - MongoDB Docs
However, i’m only able to create the search index using the UI. When i try to create using the nodejs mongodb driver or the mongo shell, i get the error: Collection <collection_name> does not exist.
On node i’m trying to do:
db.collection('view_name').createSearchIndex({
name: indexName,
type: "search", definition : {.....}})
On mongodb shell I’m trying to do:
db.collection.createSearchIndex("index_name", {.....})
Both of these options lead to the same error. Is it currently only possible through UI for views?