Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

elastic-marshal

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

elastic-marshal

Helper library for [un]marshalling elastic-builder objects

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

elastic-marshal Build Status

Helper library for [un]marshalling elastic-builder objects

Install

$ npm install elastic-marshal

Usage

'use strict';

const util = require('util');
const bob = require('elastic-builder');
const marshaller = require('elastic-marshal');

const qry = bob.boolQuery()
    .must(bob.termQuery('user', 'kimchy'))
    .must(bob.rangeQuery('age').gte(10).lte(20))
    .must(
        bob.boolQuery().should([
            bob.termQuery('tag', 'wow'),
            bob.termQuery('tag', 'elasticsearch')
        ])
    );

const qryStr = marshaller.marshal(qry);

console.log('Marshalled string -', qryStr);

const unmarshalled = marshaller.unmarshal(qryStr);

console.log('Unmarshalled object -', util.inspect(unmarshalled, true, 7, true));

The module uses elastic-builder and serialijse for serialisation and deserialisation of elastic-builder query objects.

  • elastic-builder - elasticsearch query builder
  • serialijse - serialize and deserialize javascript objects
  • elastic-muto - easy expressive search queries for elasticsearch

License

MIT © Suhas Karanth

FAQs

Package last updated on 08 Oct 2017

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