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

Unable to turn off DefaultTtl if it is already set #144

Closed
smneal opened this Issue Jul 24, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@smneal
Copy link
Contributor

smneal commented Jul 24, 2018

When updating a collection where the DefaultTtl is already set it is not possible to turn it off. When calling Set-CosmosDbCollection it will always take the existing value even if the parameter is not included.

Valid values for DefaultTtl include not specifying it at all or NULL.

I think removing the following lines should fix it:

elseif ($existingCollection.defaultTtl)
{
$bodyObject += @{
defaultTtl = $existingCollection.defaultTtl
}
}

@PlagueHO PlagueHO added the bug label Jul 24, 2018

@PlagueHO PlagueHO self-assigned this Jul 24, 2018

@PlagueHO

This comment has been minimized.

Copy link
Owner

PlagueHO commented Jul 25, 2018

What I've done is add a switch parameter RemoveDefaultTimeToLive to the function to allow removal of the default TTL. The reason for doing this is that you may want to be able to reconfigure the index on a collection without specifically changing the DefaultTimeToLive value on it (e.g. just leaving it set as is).

@PlagueHO PlagueHO closed this in 0dd548b Jul 25, 2018

@PlagueHO

This comment has been minimized.

Copy link
Owner

PlagueHO commented Jul 25, 2018

This has been released to the PS Gallery: https://www.powershellgallery.com/packages/CosmosDB/2.1.4.536

@smneal

This comment has been minimized.

Copy link
Contributor Author

smneal commented Jul 25, 2018

Many thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.