Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now available in preview.

google.appengine.datastore.datastore_index.IndexYamlForQuery

Returns the composite index definition YAML needed for a query.

Given a query, the arguments for this method can be computed with:

  _, kind, ancestor, props = datastore_index.CompositeIndexForQuery(query)
  props = datastore_index.GetRecommendedIndexProperties(props)

kind The kind or None.
ancestor True if this is an ancestor query, False otherwise.
props PropertySpec objects.

A string with the YAML for the composite index needed by the query.