How to use MongoDB Search Index from inside of an IDE

I’m using Studio3T Intellishell. We’ve just updated our M10 MongoDB cluster to MongoDB 7.0. I was under the impression that now creating text search indexes will become simpler and I’ll be able to create them straight from the IDE (previously we’ve used Cloud Portal for creating those).
I’ve tried examples from the documentation and there are a couple of them, some use the createSearchIndex command (db.getCollection("xyz").createSearchindex( etc.. )), I’m getting error that createSearchIndexfunction does not exist. I’ve also tried the:

 db.runCommand(
{
    createSearchIndexes: "xyz"

Something runs, but nothing happens.

Can I please get the full syntax with some example. Unless I’ve misunderstood release notes and this is not possible. I don’t want to use the cloud MongoDB portal to create these indexes if there’s another option.

Hey @Szymon_Katanski,

Welcome to the MongoDB Community!

Looking at the given command, I notice that you might have misspelled the createSearchIndexes().

However, the feature is available for Atlas M10+ clusters running MongoDB 6.0.8 or later introducing the ability to create and manage Atlas Search indexes from mongosh and NodeJS driver. Please see July 10, 2023 changelog and documentation to learn more about it.

Could you please attempt to run it from mongosh or MongoDB Compass as it worked successfully for me? If the problem persists, kindly provide the complete command you are attempting to execute.

Best regards,
Kushagra

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