myNamespaceModule :=myStoreModule.WithNamespace(namespace[, storeName]);
| myStoreModule | The name of the parent Store module instance |
| myNamespaceModule | The name of the namespace-specific module instance |
| namespace | A STRING naming the namespace partition that will be used for this module; cannot be an empty string; REQUIRED |
| storeName | A STRING naming the store that this module will access; set this to an empty string to reference the default store in the cluster, if one has been defined; OPTIONAL, defaults to an empty string |
| Return: | A reference to the module, correctly initialized with the given namespace |
The WithNamespace submodule nails down a specific namespace to access within a key/value store on the cluster. All subsequent operations will be scoped to this namespace.
Example:
IMPORT STD;
myStore := STD.System.Store();
// Define a namespace module
myNamespace := myStore.WithNamespace('ApplicationConfig', 'MyApplicationStore');
// Use default store with a specific namespace
defaultNamespace := myStore.WithNamespace('Settings', '');