RemoteMongoDatabase

public class RemoteMongoDatabase

The RemoteMongoDatabase represents a MongoDB database, which holds a group of collections that contain your data.

It can be retrieved from the RemoteMongoClient.

Use it to get RemoteMongoCollections for reading and writing data.

Note

Before you can read or write data, a user must log in. See StitchAuth.

  • The name of this database.

    Declaration

    Swift

    public var name: String { get }
  • Declaration

    Swift

    public func collection(_ collectionName: String) -> RemoteMongoCollection<Document>

    Parameters

    name

    the name of the collection to return

    Return Value

    the collection

  • Gets a RemoteMongoCollection with a specific default document type.

    Declaration

    Swift

    public func collection<T: Codable>(
        _ collectionName: String,
        withCollectionType type: T.Type
    ) -> RemoteMongoCollection<T>

    Parameters

    name

    the name of the collection to return

    withCollectionType

    the default class to cast any documents returned from the database into.

    Return Value

    the collection