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

managercouchdb

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

managercouchdb

Manager for CouchdDB servers and databases

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

ManagerCouchdb

ManagerCouchdb is a javascript library for managing CouchdDB servers and databases. This library was created and is maintained at the Center for Neurological Imaging (https://cni.bwh.harvard.edu/).

How to install it

npm install --save managercouchdb

How to use it

const managerCouchdb = require('managerCouchdb')

const serverManagerCouchdb = await managerCouchdb.getServerManager("localhost:5984")
const dbManagerCouchdb = await managerCouchdb.getDatabaseManager("localhost:5984", "databasename")

How to test it

Checkout project with git and run test/testAll and test/testDesign node scripts. Check SERVER_URL and DB_NAME settings if they fit to your environment.

Server manager

var serverRunning = await serverManagerCouchdb.isServerRunning()

var serverInformation = serverManagerCouchdb.getServerInformation()

var dbExist = await serverManagerCouchdb.databaseExist("databasename")

var resDestroyDatabase = await serverManagerCouchdb.destroyDatabase("databasename")

var resCreateDb = await serverManagerCouchdb.createDatabase("databasename")

Database manager

var dbInformation = await dbManagerCouchdb.getDatabaseInformation()

var resInsertDoc = await dbManagerCouchdb.insertDocument(document)

var resDestroyDoc = await dbManagerCouchdb.destroyDocument(documentId, revisionId)

var resInsertDocsBulk = await dbManagerCouchdb.insertDocumentInBulk(documents)

var document = await dbManagerCouchdb.getDocument(documentId)

var viewResults = await dbManagerCouchdb.getView(designName, viewName, keys)

var resView = await  dbManagerCouchdb.getViewWithQuery(designName,viewName, queryParams,includeDocs);

var design = await dbManagerCouchdb.getDesign()

var resFetch= await dbManagerCouchdb.fetchDocumentsInBulk(toBeFetched);

var resDel = await dbManagerCouchdb.deleteDocumentInBulk({"docs":arrayOfDocIds});


What's new in Version 2.0

Dependencies:

  • removed package request-promise-native from dependencies (package was blocking upgrade of nano to version > 8.2.3)
  • upgraded nano to version 10.0.0

Added db document functions:

  • getDesign for getting all design and view documents,
  • deleteDocumentsInBulk for deleting array of documents,
  • fetchDocumentsInBulk for fetching array of documents,
  • getViewWithQuery for getting view with different key options

Removed db document functions:

  • getViewWithMultipleQueries: not needed anymore, replaced partially by getViewWithQuery

Modified db document functions:

  • destroyDocument: revision parameter is optional,

Tests:

  • added test for Node (no testing framework is required)

Keywords

FAQs

Package last updated on 16 Oct 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