Google Cloud Datastore Python Client: Exclude Property From Index

January 12, 2019
exclude_from_indexes
from google.cloud import datastore

key = client.key('Person')

item = datastore.Entity(key, exclude_from_indexes=('address', 'note'))

item.update({
    'name': 'Desmond',
    'age': 10,
    'address': 'Secret Lane',
    'note': ''
})

# update exclude_from_indexes during runtime
item.exclude_from_indexes.add('another_property')
item.exclude_from_indexes = set(('address', 'note'))

key = client.put(item)

References:

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.