RemoteMongoDatabase

public class RemoteMongoDatabase

A class representing a MongoDB database accesible via the Stitch MongoDB service.

  • The name of this database.

    Declaration

    Swift

    public var name: String { get }
  • Gets a collection.

    Declaration

    Swift

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

    Parameters

    name

    the name of the collection to return

    Return Value

    the collection

  • Gets a collection 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