Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

moleculer-db-adapter-couchdb-nano

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moleculer-db-adapter-couchdb-nano

CouchDB Nano adapter for Moleculer DB service.

  • 0.1.14
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Moleculer logo

moleculer-db-adapter-couchdb-nano NPM version

CouchDB Nano adapter for Moleculer DB service.

Features

  • Schemaless adapter
  • CouchDB Nano driver v7

Install

$ npm install moleculer-db moleculer-db-adapter-couchdb-nano --save

Usage

"use strict";

const { ServiceBroker } = require("moleculer");
const DbService = require("moleculer-db");
const CouchDBAdapter = require("moleculer-db-adapter-couchdb-nano");

const broker = new ServiceBroker();

// Create a CouchDB service for `blog-post` entities
broker.createService({
    name: "blog",
    collection: "posts",
    adapter: new CouchDBAdapter("couchdb://localhost:5984"),
    mixins: [DbService]
});

broker.start()
// Create a new post
.then(() => broker.call("posts.create", {
    title: "My first post",
    content: "Lorem ipsum...",
    votes: 0
}))

// Get all posts
.then(() => broker.call("posts.find").then(console.log));

Options

**Example with default connection to localhost:5984 **

new CouchDBAdapter()

Example with connection URI & options

new CouchDBAdapter("couchdb://localhost:5984", {
    //any opts supported by Nano
})

Test

$ npm test

In development with watching

$ npm run ci

License

The project is available under the MIT license.

Contact

Copyright (c) 2018 Mr. Kutin

Keywords

FAQs

Package last updated on 28 Jul 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc