RemoteMongoClient
public class RemoteMongoClient
The RemoteMongoClient
enables reading and writing on a MongoDB database via the Stitch MongoDB service.
You can create one by using remoteMongoClientFactory
with StitchAppClient
‘s
serviceClient(fromFactory:withName)
method.
It provides access to instances of RemoteMongoDatabase
, which in turn provide access to specific
RemoteMongoCollection
s that hold your data.
Note
Before you can read or write data, a user must log in. See StitchAuth
.
-
Gets a
RemoteMongoDatabase
instance for the given database name.Declaration
Swift
public func db(_ name: String) -> RemoteMongoDatabase
Parameters
name
the name of the database to retrieve