Enumerations

The following enumerations are available globally.

  • Credentialsis an enum representing supported authentication types for MongoDB Realm. Example Usage:

    let credentials = Credentials.JWT(token: myToken)
    
    See more

    Declaration

    Swift

    @frozen
    public enum Credentials
  • Enum representing a BSON value.

    See also

    bsonspec.org
    See more

    Declaration

    Swift

    @frozen
    public enum AnyBSON : BSON
    extension AnyBSON: ExpressibleByStringLiteral
    extension AnyBSON: ExpressibleByBooleanLiteral
    extension AnyBSON: ExpressibleByFloatLiteral
    extension AnyBSON: ExpressibleByIntegerLiteral
    extension AnyBSON: ExpressibleByDictionaryLiteral
    extension AnyBSON: ExpressibleByArrayLiteral
    extension AnyBSON: Equatable
    extension AnyBSON: Hashable

Publishers

  • Combine publishers for Realm types.

    You normally should not create any of these types directly, and should instead use the extension methods which create them.

    See more

    Declaration

    Swift

    @available(macOS 10.15, watchOS 6.0, iOS 13.0, iOSApplicationExtension 13.0, macOSApplicationExtension 10.15, tvOS 13.0, *)
    public enum RealmPublishers
  • Information about the changes made to an object which is passed to Object‘s notification blocks.

    See more

    Declaration

    Swift

    @frozen
    public enum ObjectChange<T> where T : Object
  • A RealmCollectionChange value encapsulates information about changes to collections that are reported by Realm notifications.

    The change information is available in two formats: a simple array of row indices in the collection for each type of change, and an array of index paths in a requested section suitable for passing directly to UITableView‘s batch update methods.

    The arrays of indices in the .update case follow UITableView’s batching conventions, and can be passed as-is to a table view’s batch update functions after being converted to index paths. For example, for a simple one-section table view, you can do the following:

    self.notificationToken = results.observe { changes in
        switch changes {
        case .initial:
            // Results are now populated and can be accessed without blocking the UI
            self.tableView.reloadData()
            break
        case .update(_, let deletions, let insertions, let modifications):
            // Query results have changed, so apply them to the TableView
            self.tableView.beginUpdates()
            self.tableView.insertRows(at: insertions.map { IndexPath(row: $0, section: 0) },
               with: .automatic)
            self.tableView.deleteRows(at: deletions.map { IndexPath(row: $0, section: 0) },
               with: .automatic)
            self.tableView.reloadRows(at: modifications.map { IndexPath(row: $0, section: 0) },
               with: .automatic)
            self.tableView.endUpdates()
            break
        case .error(let err):
            // An error occurred while opening the Realm file on the background worker thread
            fatalError("\(err)")
            break
        }
    }
    
    See more

    Declaration

    Swift

    @frozen
    public enum RealmCollectionChange<CollectionType>
  • How the Realm client should validate the identity of the server for secure connections.

    By default, when connecting to MongoDB Realm over HTTPS, Realm will validate the server’s HTTPS certificate using the system trust store and root certificates. For additional protection against man-in-the-middle (MITM) attacks and similar vulnerabilities, you can pin a certificate or public key, and reject all others, even if they are signed by a trusted CA.

    See more

    Declaration

    Swift

    @frozen
    public enum ServerValidationPolicy