1.0.7 • Published 2 years ago

couchbase-rest v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

couchbase-rest

Description

This module can be used to get the data from Couchbase over REST API. All the processes are similar to couchbase SDK for Nodejs Developed By Couchbase Team. This module is a kind of wrapper and can fetch the data over REST API under the hood.

This is very helpful module when you are using Tunnel to get access to couchbase. In that case couchbase SDK of Nodejs does not work in cluster mode.

Installation

npm install couchbase-rest --save

Sample Code

Create Cluster Object

const cluster = await connect('http://localhost:8091/pools/default/buckets/%s/docs/%s', {
  username: 'username',
  password: 'password',
})

Get Bucket Object

const bucket = cluster.bucket('Bucket_Name')

Get Collection Information

const collection_default = bucket.defaultCollection()

Fetch the Value for KEYS passed

const result = await collection_default.get(key1, key2, key3)

Result would be in form of Array which will contain the results corresponding to keys passed. If specific key does not exist it would be undefined.

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago