How to create search indexes in atlas using Pymongo

I’m trying to create a Full text search functionality using Flask and Pymongo with hosted atlas.
We have a very specific use case where we need to create a new collection using the id of a customer in the customer db.
We want to add search indexes to our collections every time a new one is created. Couldn’t find a dedicated documentation how to achieve that using the Pymongo. package.

Some help would be highly appreciated

Hi @a091cdf9f526d18581e0dc80416e114 and welcome to the MongoDB Community forum!!

If I understand the question correctly, you are trying to extract _id for a specific user and trying to new collection using the extracted objectID.

Do you mean to use Atlas Search in your application? Note that this is different than text index that is available outside of Atlas.

To help us understand further, could you help us with the following information to help you with a solution.

  1. A sample document on which index is to be created.
  2. The index definition used
  3. The search query that you are trying to use.

Thanks
Aasawari