Socket
Socket
Sign inDemoInstall

couchdb-indexer

Package Overview
Dependencies
3
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    couchdb-indexer

Create or update indexes for all of your CouchDB via a single command / call.


Version published
Weekly downloads
4
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

couchdb-indexer

Both a requireable module and a CLI tool for indexing (caching) CouchDB views.

The utility functions by retrieving a database's design documents and then requesting a single row from a single view on each design document. The effect is that all views are then indexed and results can be thereafter retrieved without delay.

Options exist to filter the design documents that are indexed and to limit the number of threads used for indexing.

Module

$ npm install --save couchdb-indexer

Usage

Works with both callbacks and promises.

var ixcouch = require('couchdb-indexer');

// callback
ixcouch('http://localhost:5984/my-db', function ( err ) {
  // ...
});

// promise
ixcouch('http://localhost:5984/my-db').then(function () {
  // success
});
Options

Optionally pass an options object as the second argument. Properties:

  • [options.filter=null] {string|RegExp}: Only index views on design docs whose names match RegExp
  • [options.maxActiveTasks=NaN] {integer}: View queries are queued so as to attempt to limit the maximum number of concurrent active tasks on the CouchDB server.

CLI

$ npm install -g couchdb-indexer
$ ixcouch my-db

Usage

$ ixcouch [options] <database_url>
Options
  --filter=<string>
    Only index views on design docs whose names match JavaScript RegExp

  --max-active-tasks=<integer>
    View queries are queued so as to attempt to limit the maximum number of concurrent active tasks on the CouchDB server.
    Active tasks are queried via route: GET {server_url}/_active_tasks.

    By default, there is no maximum - i.e. all view queries are sent simultaneously.

DATABASE URL

    Can be supplied in various formats:

      Full URL

      {host}/{database_name} - inferred protocol: http

      :{port}/{database_name} - inferred protocol: http; inferred hostname: 127.0.0.1

      {database_name} - inferred protocol: http; inferred host: 127.0.0.1:5984

Keywords

FAQs

Last updated on 09 Mar 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc