Skip to content

si3nloong/rsql

Repository files navigation

Build Status

RESTful Query Language (RSQL)

Utility to generate rsql query string

Installation

Using npm:

$ npm i --save rsql
import { filter, ne, or, eq, includes, notIncludes } from 'rsql';

filter(
  eq('name', 'test'),
  includes('status', ['A', 'B', 'C']),
  notIncludes('status', ['A', 'B', 'C']),
).qs(); // $filter=(name==test;status=in=A,B,C;status=nin=A,B,C)&$limit=100

filter(ne('b', 'value'), or(eq('c', 'v2'), eq('d', 'v4'))).qs(); // $filter=(b!=value;(c==v2,d==v4))&$limit=100