Azure-docs: Index policy 'none' not compatible with a default TTL

Created on 11 Apr 2019  Â·  6Comments  Â·  Source: MicrosoftDocs/azure-docs

When I configure the index policy to 'none', I get an error "Indexing mode value cannot be 'none' when 'defaultTtl' is specified in the collection".
Would it be possible to enhance the documentation to explain how to specify a default TTL for a collection that is being used for key-value storage?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

assigned-to-author cosmos-dsvc doc-enhancement triaged

Most helpful comment

@robin-parker The TTL feature requires indexing to be active, so either of these will fail indeed:

  • Settings the indexing mode to None while TTL is activated
  • Activating TTL while the indexing mode is set to None.

To use TTL for a collection used as pure key-value pair, you can use the following policy:

{
  "indexingMode": "consistent",
  "automatic": true,
  "includedPaths": [],
  "excludedPaths": [{
    "path": "/*"
  }]
}

Thanks a lot for pointing that out, I'm updating the docs accordingly!

please-close

All 6 comments

@robin-parker Thank you for your feedback! We will review and provide an update as appropriate.

@robin-parker In looking through this, the only very slight reference that an index policy other than None might be required is in the form of a Note: on the documentation page where None should be used with access patterns that require ID or self-link only. It's a stretch but it indicates that without an indexing policy, lookups need to be direct (Indexing modes). If there was an additional note or section that addressed TTL functionality, as there is currently nothing pertaining to indexing policy requirements for TTL functionality.
I am going to assign this issue to the content author to evaluate and update as appropriate. @SnehaGunda for awareness.

We will address it in the docs. Thank you.

@ThomasWeiss has some significant updates to the indexing docs, he will cover this in his updates. We have reached out to the dev team to understand the behavior, will post the response soon.

@robin-parker The TTL feature requires indexing to be active, so either of these will fail indeed:

  • Settings the indexing mode to None while TTL is activated
  • Activating TTL while the indexing mode is set to None.

To use TTL for a collection used as pure key-value pair, you can use the following policy:

{
  "indexingMode": "consistent",
  "automatic": true,
  "includedPaths": [],
  "excludedPaths": [{
    "path": "/*"
  }]
}

Thanks a lot for pointing that out, I'm updating the docs accordingly!

please-close

Thanks for the quick response, this is now working just fine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulmarshall picture paulmarshall  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments