Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

loopback-connector-couchbasex

Wiredcraft40MIT1.2.5

LoopBack Couchbase Connector for 3,5 or higher version

LoopBack, Couchbase, DataSource, Connector

readme

loopback-connector-couchbaseX

Build Status Coverage Status

This is a Couchbase connector node module for Loopback with loopback-datasource-juggler. Without N1QL for now.

How to use

Install

npm install loopback-connector-couchbasex --save

Caveat

  • Model's function update play the same role as updateAttributes which cause by loopback-datasource-juggler.

PUT and PATCH both do the same thing that merge incoming data with current record.

 update = Object.assign(current, incoming)

Discussion of update and updateAttribetes , see: https://groups.google.com/forum/#!topic/loopbackjs/-1jarvOuh8k

  • since version 1.0.0 the default vaule of stale was set to ok in viewQuery.

If the update key is not id, you must set stale=before in options parameter to make sure you get the correct data to merge incoming data, like:

const where = { name: 'kitten' };
const update = { ...data };
options = { stale: before };
SomeModel.update(where, update, options);

About stale

DataSource Config in LoopBack

  • For Couchbase version >= 5, as default

    Update on CB Authentication @https://docs.couchbase.com/java-sdk/current/sdk-authentication-overview.html
    # datasources.json
    {
    "testDs": {
      "name": "testDs",
      "connector": "couchbasex",
      "version": 5,
      "cluster": {
        "url": "couchbase://localhost",
        "username": "username",
        "password": "password",
        "options": {}
      },
      "bucket": {
        "name": "test_bucket"
      }
    }
    }
  • For Couchbase version < 5

    # datasources.json
    {
    "testDs": {
      "name": "testDs",
      "connector": "couchbasex",
      "version": 3,
      "cluster": {
        "url": "couchbase://localhost",
        "options": {}
      },
      "bucket": {
        "name": "test_bucket",
        "password": ""
      }
    }
    }

Test

# Docker Up
./dockers/up.sh cb4
or
./dockers/up.sh cb5
./dockers/up.sh cb6

# Run Test
yarn run cb4
or
yarn run cb5
yarn run cb6

# Docker Down
./dockers/down.sh cb4
or
./dockers/down.sh cb5
./dockers/down.sh cb6

Summary

project  : loopback-connector-couchbaseX
repo age : 4 years, 1 month
active   : 61 days
commits  : 124
files    : 27

authors  :
  63  Makara Wang        50.8%
  39  CCharlieLi         31.5%
   7  chopperlee         5.6%
   4  Xavier Zhou        3.2%
   3  Leo Zhou           2.4%
   3  wwayne             2.4%
   2  greenkeeperio-bot  1.6%
   2  xavier             1.6%
   1  Marc Bachmann      0.8%

changelog

1.2.5 (2020-08-05)

Bug Fixes

  • findById can find document from other models (9bad67f)
  • immutable view options (ddf4db2)
  • remove unnecessarey setting value checking (87a65d7)

Features

  • set view stale as global setting (9800b10)

1.2.4 (2020-02-27)

Bug Fixes

  • immutable view options (ddf4db2)
  • remove unnecessarey setting value checking (87a65d7)

Features

  • set view stale as global setting (9800b10)

1.2.3 (2020-02-18)

Bug Fixes

  • objToArr with incorrect sequence index array (b02fe15)

1.2.2 (2020-01-21)

Bug Fixes

  • fix _cas cover by db in unpack function (1ca4e27)

1.2.1 (2020-01-08)

Bug Fixes

  • update lose _type field (51adea3)

1.2.0 (2020-01-07)

Bug Fixes

  • add update and create filter _cas field (a60b471)
  • fix delete object key change origin data in putWithId (73fde75)

1.1.0 (2020-01-06)

Bug Fixes

  • fix findById return without unRefs (9ccb844)
  • fix findByIds return promise in array (ed853c4)

1.0.0 (2019-09-22)

Bug Fixes

0.5.0 (2017-11-08)

0.4.2 (2017-07-26)

0.4.1 (2017-06-30)

0.4.0 (2017-02-23)

0.3.1 (2016-11-01)

0.3.0 (2016-08-16)

0.2.2 (2016-02-01)

0.2.1 (2015-12-30)

0.2.0 (2015-12-18)

0.1.0 (2015-11-10)

0.0.1 (2015-10-20)