New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

edbms

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edbms

ElasticSearch Database Management System

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Node ElasticSearch Database Management System

Professional Support Chat with contributors

  • installation $ npm install edbms

Initialization

const EDBMS = require('edbms');
EDBMS.url('http://localhost:9200');

Examples

var db = EDB();

// Listing - Performs index/_search
var builder = db.list('index');
builder.scope('query.bool.must[]');
builder.push('match', { title: 'my_search_phrase' });
builder.callback(function(err, response) {
    // ...
});

// Read single document
db.read('index', 'type', '_id').callback(function(err, response) {
    // ...
});

// Create a new document and manual refresh
db.insert('index', 'type', model).refresh().callback(function(err, response) {
    // ...
});

// Update document
db.update('index', 'type', '_id', model).callback(function(err, response) {
    // ...
});

// Partial update
db.modify('index', '_id', model).callback(function(err, response) {
    // ...
});

// Delete document
db.delete('index', 'type', 'id').callback(function(err, response) {
    // ...
});

// Delete by query
var builder = db.delete('index');
builder.scope('query.bool.must[]');
builder.push('term', { userid: 5 });
builder.callback(function(err, response) {
    // ...
});

// Custom query
// Available methods: POST (default), GET, PUT, DELETE
var builder = db.exec('GET /YOUR-INDEX/TYPE/_search');
builder.scope('query.bool.must[]');
builder.push('term', { userid: 5 });
builder.callback(function(err, response) {
    // ...
});

// Refresh index
db.refresh('index').callback(function(err, response) {
    console.log(err, response);
});

// Count of documents
var builder = db.count('index');
builder.scope('query.bool.must[]');
builder.push('term', { userid: 5 });
builder.callback(function(err, response) {
    // ...
});

Keywords

database

FAQs

Package last updated on 31 Aug 2019

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