Create App Endpoints

      +
      1. From the project page, select the App Services tab.

      2. If you have not created an App Service then you will need to create one before you can create an endpoint.

      3. Select your App Service from the list.

      4. Click on Create App Endpoint

      creating the App Endpoint
      Figure 1. Creating an App Endpoint

      Concepts

      • An App Endpoint is a service that handles syncing and security between your Capella database and mobile application.

      • Every App Endpoint syncs to a bucket on your database.

      • An App Service can have multiple App Endpoints.

      Basics

      Choose which database bucket to synchronize. Each App Endpoint is connected to exactly one bucket.

      the Bucket selected must NOT have an Eventing function with read/write bindings

      You can update the Authentication Provider in a later step.

      Notice that your App Endpoint starts out in a Paused state. We encourage you to create an Access Control Function before resuming it. That way you can ensure that your App Endpoint is set up with the right policies before you make it available for data sync.

      Delta Sync

      Delta Sync provides the ability to replicate only those parts of a Couchbase document that have changed. This can result in significant savings in bandwidth consumption as well as throughput improvements, especially useful where network bandwidth is constrained.

      Import Filter

      The purpose of the import filter is to identify the subset of documents eligible to be replicated by App Services. This subset is based on application requirements and is applied to all future mutations.

      Without a filter (the default), the App Service imports all documents that are inserted or mutated in the Couchbase Capella bucket. This default setting is recommended unless and until you find a compelling use-case against it.

      To add an Import Filter, first "Enable" it, then enter or import a simple Javascript function into the code editor.

      The function accepts a "Document", which is a JavaScript object representing the value stored in the database. You should return a Boolean (true or false) to determine whether to import a document.

      For example, if you have stored the document:

      {
          "id": "0001",
          "type": "mobile",
          "value": "example"
      }

      Then the following Import Filter would select this record and make it available for the endpoint:

      function (doc) {
          return doc.type == 'mobile'; // returns `true` or `false`
      }
      The Javascript function is executed with Otto and has no access to any Capella data or features other than the doc argument.

      Once the document has been imported and processed by the App Endpoint, changing the Import Filter will not remove it, even if the updated import filters would prevent newer mutations or iterations of the document from getting imported. The Import Filter is designed for a coarse-grained filter only. Look instead to the Access Control & Data Validation function support for fine-grained read/write access control.