Cloud object represents a public or private database in an app container.
- CloudKit JS 1.0+
- CloudKit JS
Each container has a public database whose data is accessible to all users and, if the current user is signed in, a private database whose data is accessible only by the current user. A database object applies operations to records, subscriptions, and zones within a database.
You do not create database objects yourself, nor should you subclass the
Cloud class. You get a database object using either the
private properties in the
Cloud class. You get a
Cloud object using methods in the
Cloud namespace. For example, use
get to get the default container object.
Read access to the public database doesn’t require that the user sign in. Your web app may fetch records and perform queries on the public database, but by default your app may not save changes to the public database without a signed-in user. Access to the private database requires that the user sign in. To determine whether a user is authenticated, see
The asynchronous methods in this class return a
Promise object that resolves when the operation completes or is rejected due to an error. For a description of the
Promise class returned by these methods, go to Mozilla Developer Network: Promise.
This class is similar to the
CKDatabase class in the CloudKit framework.
Creating Your Schema