Class Scope
An object representing a Couchbase Lite Scope. Scopes are a grouping level above Collection objects that can segregate data. There is not a direct SQL equivalent but it can be thought of a a logical grouping of tables with potential foreign key links.
Inheritance
Implements
Inherited Members
Namespace: Couchbase.Lite
Assembly: Couchbase.Lite.dll
Syntax
public sealed class Scope : IDisposable
Properties
| Improve this Doc View SourceDatabase
Gets the database that this scope belongs to
Declaration
public Database Database { get; }
Property Value
Type | Description |
---|---|
Database |
Name
Gets the Scope Name
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Naming rules: Must be between 1 and 251 characters in length. Can only contain the characters A-Z, a-z, 0-9, and the symbols , -, and %. Cannot start with or %. Case sensitive.
Methods
| Improve this Doc View SourceDispose()
Declaration
public void Dispose()
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetCollection(String)
Gets one collection of the given name. Note that this will cache after the first retrieval and return the same instance until said instance is disposed. Be careful if using multiple instances because disposing one will invalidate them all.
Declaration
public Collection GetCollection(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The collection name |
Returns
Type | Description |
---|---|
Collection | The collection of the given name. null if the collection doesn't exist in the Scope |
Exceptions
Type | Condition |
---|---|
CouchbaseException | Thrown if an error condition is returned from LiteCore |
CouchbaseLiteException | Thrown with LiteCore.Interop.C4ErrorCode.NotFound if Database is closed |
System.InvalidOperationException | Thrown if Collection is not valid. |
GetCollections()
Get all collections in this scope object.
Declaration
public IReadOnlyList<Collection> GetCollections()
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<Collection> | All collections in this scope object. Empty list if these is no collection in the Scope. |
Exceptions
Type | Condition |
---|---|
CouchbaseException | Thrown if an error condition is returned from LiteCore |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |