This is the ThingsDB documentation for version v0, click here for the latest version!
Modules can be restricted for usage in a single scope. This can be a @collection:.. scope, but also a @node or @thingsdb scope.
This function can be used to change the module scope. When the scope is set to nil, the module can be used in any scope.
This function generates an event.
set_module_scope(name, scope)
| Argument | Type | Description |
|---|---|---|
| name | str (required) | Name of the module. |
| scope | str/nil (required) |
Returns nil if successful.
This code changes the module configuration for module DEMO:
// Restrict module usage to collection `stuff`
set_module_scope('DEMO', '//stuff');
Return value in JSON format
null