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

equery

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

equery

Query builder for Elasticsearch

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

equery

npm version Build Status

Query builder for elasticsearch (Node.js / Javascript)

Installation

$ npm install equery

Usage

Building a query

var Query = require('equery');

var query = new Query();

query.toJSON

var result = q.toJSON();

query.sort

query
    .sort('followers:desc')
    .toJSON();

query.term

query
    .term('field', 'value')
    .toJSON();

PAgination

query.limit(100);
query.skip(10);

Chain

Queries are chainable:

query
    .term('user', 'Kimchy')
    .sort('followers:desc')
    .limit(100)
    .skip(10)
    .toJSON();

Filters

A filter can be set on the query using query.filter(filer). Multiple calls to query.filter is equivalent to filter1 AND filter2 AND ...

Filter.Term
query.filter(
    Query.Filter.Term('user', 'Kimchy')
)
Filter.Bool
query.filter(
    Query.Filter.Bool()
    .must(Query.Filter.Term('user', 'Kimchy'))
    .mustNot(Query.Filter.Term('user', 'Kimchy'))
)

FAQs

Package last updated on 16 Nov 2015

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