Working with the Collections Developer Preview

    +
    Collections is introduced as a Developer Preview feature in Couchbase Server 6.5. The 3.0 API SDKs all work with Collections and Scopes. As a practical demonstration, we have a collections-enabled version of the Travel Sample application.

    The Developer Preview of the upcoming Collections feature in Couchbase Server is fully implemented in the 3.0 API versions of the Couchbase SDKs. When working with other server versions, the defaultcollection is used from the SDK. Here we show how to access individual collections in the Developer Preview version of Couchbase Server 6.5, with a collections-enabled version of our Travel Sample application. User documents and flight documents are split into user and flight collections. Something that previously had to be done with key-value references to different types or categories of data.

    Travel Sample app — with Collections

    Travel Sample Application uses the Travel Sample data Bucket, which ships with Couchbase Server. For Couchbase Server 6.5, make sure that you have at least one node each of data; query; index; and search. For a development box, mixing more than one of these on a single node (given enough memory resources) is perfectly acceptable. If you have yet to install Couchbase Server in your development environment, start here.

    Then load up the Travel Sample Bucket, using either the Web interface or the command line. You will also need to create a Search Index — Query indexes are taken care of by the Sample Bucket.

    Enabling Developer Preview should only be done on a development machine; there is no upgrade path available from a DP-enabled Couchbase Server.

    Preparation

    As well as the Node.js SDK 3.0 and Couchbase Server, set up as described above, you will need git to fetch the travel sample application code: