I would like to make a backup of all user data in the datastore. My application is using the new namespace feature to provide multi tenanting on a per user basis (as per the example in the docs).
The bulk loader needs the namespace for each customer to download the data. I don't keep a list of users, so I can't generate the namespaces. Is there a method of detecting all the currently used namespaces?
There is also now a get_namespaces() function:
get_namespaces() returns a list of Namespace objects. The docs also note that "metadata queries that fetch information on namespaces, kinds, and properties are generally slow to execute."
Using
ndb
Using
datastore
Per Datastore Metadata:
There's no API to get a list of namespaces. You must keep a record of the ones you use. I use a model specifically for this.
Since SDK 1.4.0 you can use Metadata Queries:
For NDB the import is slightly different: