0.1.4 • Published 7 years ago

sqltoes v0.1.4

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

sqltoes (sql to ES)

Writing elasticsearch commands is hard, writing SQL queries is...less hard

Motivation: Elasticsearch commands are confusing to write at a certain point. See the Elasticsearch reference for more help.

Installation

npm install sqltoes

Use

sqlToES({select: ['sum(value)'], where: ['commodity = rice'], groupBy: ['description','year']})

How it works (and what works so far)

Looks for three properties: select, where, and groupBy (currently requires them all)

  • Anything in the select clause is ignored unless it is wrapped in sum, min, max, or avg all of which become a final aggregation
  • The where clause supports two types of queries:
    • [field] = [value] will be treated as a term filter.
    • [field] in ([value1],value[2]) will be treated as a terms filter.
  • Anything in the groupBy clause is treated like the second example shown here.

Similar works

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago