Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing Collection createIndex? #30

Open
GCSBOSS opened this issue Jul 5, 2023 · 4 comments
Open

missing Collection createIndex? #30

GCSBOSS opened this issue Jul 5, 2023 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@GCSBOSS
Copy link

GCSBOSS commented Jul 5, 2023

Is there any possibility top add the createIndex command for collection?

@erfanium erfanium added the help wanted Extra attention is needed label Jul 5, 2023
@erfanium
Copy link
Owner

erfanium commented Jul 5, 2023

@GCSBOSS Hey, thanks for reaching out

Do have any idea of how we can implement it? is there any api?

@juratori
Copy link

I haven't tested it myself, but you should be able to add support for the createIndexes operation in the Collection class by implementing it as follows:

async createIndexes(indexes: Document[]): Promise<Document[]> {
  return this.callApi("createIndexes", { indexes });
}

@erfanium
Copy link
Owner

erfanium commented Jul 27, 2023

@juratori Can you send me the docs for createIndexes api route? I can't find anything related here https://www.mongodb.com/docs/atlas/api/data-api-resources/

It may works, but it's not documented anywhere

@juratori
Copy link

juratori commented Jul 28, 2023

@erfanium you are right! createIndexes doesn't seem to be a built-in route within the 'Atlas Data API'. Instead, I found that it is documented in the 'MongoDB Manual' and is considered a part of the 'MongoDB Atlas Administration API'

It appeared to me that the createIndexes operation is available for use, but it may not be as straightforward as I initially assumed. Implementing it could involve additional steps, such as dropping and listing indexes, and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants