
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
feathersjs-couchbase
Advanced tools
FeathersJS DB adapter for couchbase
npm install feathersjs-couchbase --save
This library only sanitizes values and does not sanitize any keys. It is a plan to build into the query builder a sanitization layer but for now it is open to attacks. This can be easily mitigated by validating your input and excluding any keys not expected from your input.
{
"; SELECT * FROM `admin`; /*": "*/"
}
const couchbase = require('couchbase')
const cluster = new couchbase.Cluster('couchbase://127.0.0.1')
const bucketName = 'default';
const bucket = cluster.openBucket(bucketName)
const config = {
name: 'users', // Name of service and key prefix (REQUIRED)
bucket: bucketName, // Couchbase bucket name (REQUIRED)
connection: bucket, // Bucket connection, or promise that resolves to connection (REQUIRED)
separator: '::' // optional key separator (defaults to `::`)
couchbase: couchbase, // optional couchbase dependency (OPTIONAL)
id: 'id', // ID field to use (OPTIONAL) (defaults to `uuid`)
paginate: app.get('paginate'), // (OPTIONAL)
};
// Initialize our service with all options it requires
app.use(`/${options.name}`, new Service(options));
const createService = require('feathersjs-couchbase')
// Method 1
app.use('/',createService(config));
// Method 2
const { CouchService } = require('feathersjs-couchbase');
new CouchService(config)
'use strict';
const { CouchService } = require('feathersjs-couchbase');
class Users extends CouchService {
constructor(opts){
super(opts);
}
create(data, params){
return super.create(
Object.assign({ // Your default data here
auth0Id: null,
role: 'default',
}, data) // Data passed in
, params);
}
}
module.exports = Rooms;
The library implements the full feathersjs common api and Query api, see limitations for exceptions.
Finds will not work until an index is built over the bucket you're trying to query
N1QL Consistency special parameter. Consistency Documentation
const { QueryConsistency } = require('feathersjs-couchbase');
Service.find({
query: {
$consistency: QueryConsistency.NOT_BOUNDED
...
}
});
Consistency Levels:
Omitting $consistency results in the default consistency of 'at_plus';
Due to the nature of removing items, you may want to retrieve the CAS value. Calling Service.remove(..., { $return: true }) will remove the
entity and return the removed CAS value instead of the original object.
{ thing: { one: 1, $lt: 2 } }) --> thing.one = 1 AND thing < 2Copyright (c) 2018
Licensed under the MIT license.
Directives - A directive as used in this project is a special query definition. An example of a directive would be $in, $limit, or $skip.
SingleValueDirective and FieldValueDirective are both directives (usually equality) that relate a singular value or a mapped field. A mapped field can either be a directive itself or a subvalue of a parent object.
query: {
//Results in a FieldValueDirective that builds `top < $1`
top: {
$lt: 1
},
//Results in a FieldValueDirective that builds `sub.one = $2`
sub: {
one: 1
}
}
v3.0.1:
v3.0.0:
v2.5.0:
v2.4.0:
v2.3.0:
one.two = 1query: {
one: {
two: 1
}
}
v2.2.0:
FAQs
FeathersJS DB adapter for couchbase
We found that feathersjs-couchbase demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.