🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

couchdb-manager

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

couchdb-manager

CouchDB Management Tool

1.0.8
latest
Version published
Maintainers
0
Created

CouchDB Management Tool

A Node.js package for managing CouchDB databases. This tool automates the creation of databases, adding or updating views, and indexing documents in CouchDB.

Features Database Creation: Automatically create databases in CouchDB. View Management: Add or update views within existing databases. Document Indexing: Index documents to enhance query performance.

Installation

How to use it

const couchdbManager = require("couchdb-manager");
let viewDoc = {
  _id: "_design/view",
  views: {
    all: {
      map: "function (doc) { emit(doc._id, 1);}",
    },
  },
  language: "javascript",
};

const dbs = [
  {
    user_name: "root",
    password: "root",
    service_url: "localhost", // assume db host in localhost just use localhost
    service_port: 5000,
    db_name: "test",
    view_document: viewDoc,
  },
];

const create = async () => {
try {
  var x = await couchdbManager.createDB(dbs);
    console.log("appboot db create info", x);
  } catch (error) {
    console.log(" appboot db create error", error);
  }
};

create();

FAQs

Package last updated on 12 Aug 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