rsql
v1.0.7
Published
RSQL query string generator
Downloads
177
Maintainers
Readme
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