realm library

Classes

ApiKey
A class representing an API key for a User. It can be used to represent the user when logging in instead of their regular credentials. These keys are created or fetched through User.apiKeys.
ApiKeyClient
A class exposing functionality for users to manage API keys from the client. It is always scoped to a particular User and can only be accessed via User.apiKeys
App Application
An App is the main client-side entry point for interacting with an Atlas App Services application.
AppConfiguration Application
A class exposing configuration options for an App
Indicates that the field it decorates is the inverse end of a relationship.
CancellationToken
A token for controlling the cancellation of Cancellable operations.
ClientResetHandler Sync
ClientResetHandler is triggered if the device and server cannot agree on a common shared history for the realm file or when it is impossible for the device to upload or receive any changes. This can happen if the server is rolled back or restored from backup.
Configuration Configuration
Configuration used to create a Realm instance
ConnectionStateChange
A type containing information about the transition of a connection state from one value to another.
Credentials Application
A class, representing the credentials used for authenticating a User
DiscardUnsyncedChangesHandler Sync
A client reset strategy where any not yet synchronized data is automatically discarded and a fresh copy of the synchronized realm is obtained.
DisconnectedSyncConfiguration Configuration
DisconnectedSyncConfiguration is used to open Realm instances that are synchronized with MongoDB Atlas, without establishing a connection to Atlas App Services. This allows for the synchronized realm to be opened in multiple processes concurrently, as long as only one of them uses a FlexibleSyncConfiguration to sync changes.
DynamicRealm Realm
Exposes a set of dynamic methods on the Realm object. These don't use strongly typed classes and instead lookup objects by string name.
DynamicRealmObject Realm
Exposes a set of dynamic methods on the RealmObject type. These allow you to access properties by name rather than via the strongly typed API.
EmailPasswordAuthProvider Application
A class, encapsulating functionality for users, logged in with Credentials.emailPassword(). It is always scoped to a particular app.
FlexibleSyncConfiguration Configuration
FlexibleSyncConfiguration is used to open Realm instances that are synchronized with MongoDB Atlas.
FunctionsClient
A class exposing functionality for calling remote Atlas Functions.
Ignored Annotations
Indicates an ignored property.
Indexed Annotations
Indicates an indexed property.
InMemoryConfiguration Configuration
InMemoryConfiguration is used to open Realm instances that are temporary to running process.
LocalConfiguration Configuration
LocalConfiguration is used to open local Realm instances, that are persisted across runs.
ManualRecoveryHandler Sync
A client reset strategy where the user needs to fully take care of a client reset.
MapTo Annotations
MapTo annotation for class level and class member level.
Migration Realm
A Migration object is passed to you when you migrate your database from one version to another. It contains the properties for the Realm before and after the migration. After the migration is complete, newRealm will become the authoritative version of the file.
MigrationRealm Realm
A class used during a migration callback. It exposes a set of dynamic API as well as the Realm config and schema.
Move
Contains index information about objects that moved within the same collection.
MutableSubscriptionSet Sync
A mutable view to a SubscriptionSet. Obtained by calling SubscriptionSet.update.
ObjectId
ObjectId
PrimaryKey Annotations
Indicates a primary key property.
Realm Realm
A Realm instance represents a Realm database.
RealmList<T extends Object?> Realm
Instances of this class are live collections and will update as new elements are either added to or deleted from the collection or from the Realm.
RealmListChanges<T extends Object?>
Describes the changes in a Realm list collection since the last time the notification callback was invoked.
RealmLogLevel Realm
Specifies the criticality level above which messages will be logged by the default sync client logger.
RealmModel Annotations
Annotation class used to define Realm data model classes and their properties
RealmObjectChanges<T extends RealmObjectBase>
Describes the changes in on a single RealmObject since the last time the notification callback was invoked.
RealmResults<T extends Object?> Realm
Instances of this class are live collections and will update as new elements are either added to or deleted from the Realm that match the underlying query.
RealmResultsChanges<T extends Object?>
Describes the changes in a Realm results collection since the last time the notification callback was invoked.
RealmSchema Configuration
Describes the complete set of classes which may be stored in a Realm
RealmSet<T extends Object?>
RealmSet is a collection that contains no duplicate elements.
RealmSetChanges<T extends Object?>
Describes the changes in a Realm set collection since the last time the notification callback was invoked.
RealmValue
A type that can represent any valid realm data type, except collections and embedded objects.
RecoverOrDiscardUnsyncedChangesHandler Sync
A client reset strategy that attempts to automatically recover any unsynchronized changes. If that fails, this handler fallsback to the discard unsynced changes strategy.
RecoverUnsyncedChangesHandler Sync
A client reset strategy that attempts to automatically recover any unsynchronized changes.
SchemaObject Configuration
A collection of properties describing the underlying schema of a RealmObjectBase.
SchemaProperty Configuration
Describes a property on RealmObject/EmbeddedObject with its name, type and other attributes in the RealmSchema
Session Sync
An object encapsulating a synchronization session. Sessions represent the communication between the client (and a local Realm file on disk), and the server. Sessions are always created by the SDK and vended out through various APIs. The lifespans of sessions associated with Realms are managed automatically.
Subscription Sync
A class representing a single query subscription. The server will continuously evaluate the query that the app subscribed to and will send data that matches it as well as remove data that no longer does.
SubscriptionSet Sync
A collection representing the set of active subscriptions for a Realm instance.
SyncProgress
A type containing information about the progress state at a given instant.
Transaction
Provides a scope to safely write data to a Realm. Can be created using Realm.beginWrite or Realm.beginWriteAsync.
User Application
This class represents a user in an Atlas App Services application. A user can log in to the server and, if access is granted, it is possible to synchronize the local Realm to MongoDB Atlas. Moreover, synchronization is halted when the user is logged out. It is possible to persist a user. By retrieving a user, there is no need to log in again. Persisting a user between sessions, the user's credentials are stored locally on the device, and should be treated as sensitive data.
UserIdentity
The user identity associated with a User
Uuid
Represents a RFC 4122 UUID. More generally, any 128-bit byte sequence can be represented by this class, but the semantics for the fields described in the may not apply for other variants.

Enums

AuthProviderType Application
An enum containing all authentication providers. These have to be enabled manually for the application before they can be used. Authentication Providers Docs
ConnectionState
The current connection state of a Session object
GeneralSyncErrorCode
General sync error codes
MetadataPersistenceMode Application
Specify if and how to persists user objects.
ObjectType Annotations
An enum controlling the base type for a RealmModel.
ProgressDirection
The transfer direction (upload or download) tracked by a given progress notification subscription.
ProgressMode
The desired behavior of a progress notification subscription.
RealmCollectionType Configuration
All supported Realm collection types.
RealmPropertyType Configuration
All supported Realm property types.
SessionState
The current state of a Session object
SubscriptionSetState Sync
SyncClientErrorCode
Protocol errors discovered by the client.
SyncConnectionErrorCode
Protocol connection errors discovered by the server, and reported to the client
SyncErrorCategory
The category of a SyncError.
SyncResolveErrorCode
Protocol network resolution errors.
SyncSessionErrorCode
Protocol session errors discovered by the server, and reported to the client
UserState
The current state of a User.

Mixins

RealmEntity
RealmObjectBase Realm
An object that is persisted in Realm.

Typedefs

AfterResetCallback = FutureOr<void> Function(Realm beforeResetRealm, Realm afterResetRealm)
Callback that indicates a Client Reset has just happened.
BeforeResetCallback = FutureOr<void> Function(Realm beforeResetRealm)
Callback that indicates a Client Reset is about to happen.
ClientResetCallback = FutureOr<void> Function(ClientResetError clientResetError)
The signature of a callback that will be triggered when a Client Reset error happens in a synchronized Realm.
InitialDataCallback = void Function(Realm realm)
The signature of a callback that will be executed only when the Realm is first created.
MigrationCallback = void Function(Migration migration, int oldSchemaVersion)
The signature of a callback that will be executed when the schema of the Realm changes.
ProgressCallback = void Function(SyncProgress syncProgress) Realm
The signature of a callback that will be executed while the Realm is opened asynchronously with Realm.open. This is the registered onProgressCallback when calling open that receives progress notifications while the download is in progress.
ShouldCompactCallback = bool Function(int totalSize, int usedSize)
The signature of a callback used to determine if compaction should be attempted.
SyncErrorHandler = void Function(SyncError)
The signature of a callback that will be invoked whenever a SyncError occurs for the synchronized realm.

Exceptions / Errors

AppException
An exception thrown from operations interacting with a Atlas App Services app.
CancelledException
ClientResetError Sync
An error type that describes a client reset error condition.
GeneralSyncError
A general or unknown sync error
RealmClosedError Realm
An error throw when operating on an object that has been closed.
RealmError Realm
A base class of all Realm errors.
RealmException Realm
An exception being thrown when a Realm operation or RealmObject access fails.
RealmStateError
Thrown if the Realm operation is not allowed by the current state of the object.
RealmUnsupportedSetError Realm
Thrown if the operation is not supported.
SyncClientError Sync
An error type that describes a session-level error condition.
SyncConnectionError Sync
An error type that describes a connection-level error condition.
SyncError Sync
Thrown when an error occurs during synchronization
SyncResolveError
Network resolution error
SyncSessionError Sync
An error type that describes a session-level error condition.
UserCallbackException Realm
An exception throws during execution of a user callback - e.g. during migration or initial data population.