get Scope
Returns information about a scope and its collections.
Parameters
scope Name
Name of the scope to inspect.
Throws
Scope Not Found Exception
if the bucket does not have a scope with this name.
Samples
// Create a new scope using an existing scope as a template.
// (The new scope will have collections with the same names
// as the template's collections.)
val manager: CollectionManager = bucket.collections
val templateScopeSpec: ScopeSpec = manager.getScope("existing-scope")
val nameOfNewScope = "new-scope"
manager.createScope(nameOfNewScope)
templateScopeSpec.collections
.filter { it.name != "_default" } // can't create default collection
.forEach { manager.createCollection(it.copy(scopeName = nameOfNewScope)) }Content copied to clipboard