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

Configure composite index with New-CosmosDbCollectionIndexingPolicy #357

Closed
4ybaka opened this issue May 6, 2020 · 5 comments · Fixed by #359
Closed

Configure composite index with New-CosmosDbCollectionIndexingPolicy #357

4ybaka opened this issue May 6, 2020 · 5 comments · Fixed by #359
Assignees
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.

Comments

@4ybaka
Copy link

4ybaka commented May 6, 2020

How can I specify composite index with New-CosmosDbCollectionIndexingPolicy? I see no such parameter in cmdlet.

@PlagueHO PlagueHO added question The issue is a question. enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. and removed question The issue is a question. labels May 6, 2020
@PlagueHO
Copy link
Owner

PlagueHO commented May 6, 2020

Hi @4ybaka - this is something I haven't added support for, but it is fairly straight forward for me to add. I'll aim to implement this over the weekend.

I'll need to add a couple more cmdlets that allow them to be created:
https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-manage-indexing-policy#composite-index-defined-for-name-asc-age-asc-and-name-asc-age-desc

@PlagueHO PlagueHO self-assigned this May 8, 2020
@PlagueHO PlagueHO added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels May 8, 2020
@PlagueHO
Copy link
Owner

PlagueHO commented May 8, 2020

Starting work on this now.

@PlagueHO
Copy link
Owner

I've completed the work on this now. I had to update the module to use the 2018-09-17 version of the REST APIs, which was the first version that supported composite indexes. This resulted in a change in how index policies are applied to collections, so I've made this a BREAKING CHANGE, which will result in a new major version being released.

I'm going to make one further change to allow indexes to be set via JSON as well as an object, so that if there are any specific index patterns that aren't supported by this module then you can still manually set them.

Expect this to be released to PS Gallery later on today.

@PlagueHO
Copy link
Owner

Hi @4ybaka - this has been released in v4.0.0 - https://www.powershellgallery.com/packages/CosmosDB/4.0.0

@4ybaka
Copy link
Author

4ybaka commented May 12, 2020

Great! Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants