Socket
Socket
Sign inDemoInstall

elasticsearch-extend

Package Overview
Dependencies
14
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    elasticsearch-extend

extended elasticsearch with ODM functions


Version published
Weekly downloads
5
increased by400%
Maintainers
1
Install size
4.39 MB
Created
Weekly downloads
 

Readme

Source

elasticsearch-extend

npm version

Extended official elasticsearch module with ODM functions

Features

  • Compatible with official elasticsearch
  • ES6 syntax(generator, class, etc).

How to use

Init es connection:

const es = require('elasticsearch-extend');

es.connect({
    host: 'localhost:9200',
    log: 'info'
})
.then(function(){ ... })
.catch(function(error){ ... });

Once connected, register a model:

const UserModel = es.model('user', {
    username: { type: "string"},
    phone: { type: "string"}
});

Get a registered model:

const UserModel = es.model('user');

APIs

es.connect(params)

Connect to an elasticsearch server

es.isConnected

Indicate whether elasticsearch connected or not

es.model(modelName, mapping)

Register a model

es.model(modelName)

Get a model

Model APIs
model.createOne(params)

Create one document

model.list(params)

List documents

ToDos

  • More model APIs
  • Document APIs

Keywords

FAQs

Last updated on 28 Jun 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