I am wondering how to retrieve all kind names that are stored in the google cloud datastore in Python. I am thinking of using a query,
client = datastore.Client()
query = client.query()
results = query.fetch()
but it only gets all the entities stored by the default client. So how to get all the kinds' names in this case?
You can use a kind metadata query to fetch the kind names.
If you're using the Google Cloud Python library, it would look like:
query = client.query(kind='__kind__')
query.keys_only()
kinds = [entity.key.id_or_name for entity in query.fetch()]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With