Remote MongoDB Service
-
The
remoteMongoClientFactory
can be used to create aRemoteMongoClient
with aStitchAppClient
.Use this with
StitchAppClient.serviceClient(fromFactory:withName)
to get aRemoteMongoClient
.Declaration
Swift
public let remoteMongoClientFactory: AnyNamedThrowingServiceClientFactory<RemoteMongoClient>
-
The
RemoteMongoClient
enables reading and writing on a MongoDB database via the Stitch MongoDB service.You can create one by using
remoteMongoClientFactory
withStitchAppClient
‘sserviceClient(fromFactory:withName)
method.It provides access to instances of
RemoteMongoDatabase
, which in turn provide access to specificRemoteMongoCollection
s that hold your data.Note
Before you can read or write data, a user must log in. See
StitchAuth
.Declaration
Swift
public class RemoteMongoClient
-
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
RemoteMongoCollection
s for reading and writing data.Note
Before you can read or write data, a user must log in. See
StitchAuth
.See also
Declaration
Swift
public class RemoteMongoDatabase
-
The
RemoteMongoCollection
represents a MongoDB collection.You can get an instance from a
RemoteMongoDatabase
.Create, read, update, and delete methods are available.
Operations against the Stitch server are performed asynchronously.
Note
Before you can read or write data, a user must log in. See
StitchAuth
.See also
Declaration
Swift
public class RemoteMongoCollection<T> where T : Decodable, T : Encodable
-
RemoteMongoCursor
allows asynchronous traversal of the result of afind
oraggregate
operation on aRemoteMongoCollection
.You can obtain an instance of the cursor by calling
See moreRemoteMongoReadOperation
‘siterator(completionHandler:)
method.RemoteMongoReadOperation
is the result of a find or aggregate operation on aRemoteMongoCollection
.Declaration
Swift
public class RemoteMongoCursor<T> where T : Decodable, T : Encodable
-
RemoteMongoReadOperation
represents afind
oraggregate
operation on aRemoteMongoCollection
.The methods in this class execute the operation and retrieve the results.
See also
RemoteMongoCollection
Declaration
Swift
public class RemoteMongoReadOperation<T> where T : Decodable, T : Encodable
-
Sync
is a set of synchronization-related operations for aRemoteMongoCollection
.Using Sync, you can synchronize local and remote data.
See also
Build a Mobile App with Sync, RemoteMongoCollectionDeclaration
Swift
public class Sync<DocumentT> where DocumentT : Decodable, DocumentT : Encodable