All Projects → bodia-uz → odata-filter-builder

bodia-uz / odata-filter-builder

Licence: MIT License
OData Filter Builder

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to odata-filter-builder

cloud-abap-rap
This repository contains several examples how to develop with the ABAP RESTful Application Programming Model (RAP) in SAP BTP, ABAP environment.
Stars: ✭ 98 (+133.33%)
Mutual labels:  odata
java-web-servlet-filter
OpenTracing Java Web Servlet Filter Instrumentation
Stars: ✭ 20 (-52.38%)
Mutual labels:  filter
material-ui-filter
Material UI Drawer for filtering local arrays
Stars: ✭ 43 (+2.38%)
Mutual labels:  filter
MacOSX-FileSystem-Filter
A file system filter for Mac OS X
Stars: ✭ 72 (+71.43%)
Mutual labels:  filter
abap-odata-smoke-test
This ABAP Report performs simple smoke tests for activated ODATA services, providing basic automated testing for your ODATA endpoints.
Stars: ✭ 13 (-69.05%)
Mutual labels:  odata
arcade-manager
Arcade management tool to handle your MAME/FBA romsets
Stars: ✭ 104 (+147.62%)
Mutual labels:  filter
hex-to-css-filter
Easy way to generate colors from HEX to CSS Filters
Stars: ✭ 20 (-52.38%)
Mutual labels:  filter
image-editor-effects
💎 A WebGL example of image adjustment / effects shaders found in Photoshop, other image editors and game engines.
Stars: ✭ 68 (+61.9%)
Mutual labels:  filter
spark-ar-creators
List of 9500 (and counting) Spark AR Creators. Open an issue or contact me if you want to be added.❤️
Stars: ✭ 122 (+190.48%)
Mutual labels:  filter
iirj
An efficient IIR filter library written in JAVA
Stars: ✭ 95 (+126.19%)
Mutual labels:  filter
SOUL-VA
The SOUL Virtual Analog Library
Stars: ✭ 45 (+7.14%)
Mutual labels:  filter
dynamic-table
Dynamic Table jQuery Plug-in - A table that can be sorted, filtered and edited, similar to common spreadsheet application.
Stars: ✭ 26 (-38.1%)
Mutual labels:  filter
filter
Go语言的数据过滤包,由 数据输入、格式化、校验、输出 几个部份组成。
Stars: ✭ 22 (-47.62%)
Mutual labels:  filter
advanced-post-list
A WordPress plugin to create custom post lists
Stars: ✭ 15 (-64.29%)
Mutual labels:  filter
obj-filter
JavaScript Object Filter. Deep filtering key/content recursively. Support wildcard, nested, and filter function in template.
Stars: ✭ 13 (-69.05%)
Mutual labels:  filter
vue-date-fns
Date filter for Vue based on the date-fns.
Stars: ✭ 21 (-50%)
Mutual labels:  filter
keeporsweep.net
💻🔀🗑️ Randomly declutter your digital life!
Stars: ✭ 54 (+28.57%)
Mutual labels:  filter
GenericRecyclerAdapter
Easiest way to use RecyclerView. Reduce boilerplate code! You don't need to write adapters for listing pages anymore!
Stars: ✭ 53 (+26.19%)
Mutual labels:  filter
pandocker
🐳 A simple docker image for pandoc with filters, templates, fonts, and the latex bazaar
Stars: ✭ 118 (+180.95%)
Mutual labels:  filter
jellex
TUI to filter JSON and JSON Lines data with Python syntax
Stars: ✭ 41 (-2.38%)
Mutual labels:  filter

OData Filter Builder

ODataFilterBuilder is util to build $filter part for OData URL query options

npm version Build Status Coverage Status

Documentation

Installation

The fastest way to get started is to serve JavaScript from the unpkg:

<!-- NOTE: See https://unpkg.com how to use specific vesion. -->
<!-- NOTE: not minified version - https://unpkg.com/[email protected]/dist/odata-filter-builder.js -->
<script src="https://unpkg.com/[email protected]/dist/odata-filter-builder.min.js"></script>
// now you can find the library on window.ODataFilterBuilder
var f = ODataFilterBuilder;

And it's just as easy with npm:

$ npm install --save odata-filter-builder
// using ES6 modules
import f from 'odata-filter-builder';
// using CommonJS modules
var f = require('odata-filter-builder').ODataFilterBuilder;

Also you can try it in your browser

How to use

f([condition='and'])

Constructor for ODataFilterBuilder class. Create new instance of filter builder. Can be used without new operator.

parameter type description
[condition='and'] string optional: base condition ('and'/'or').

Examples

// can be used without "new" operator
// default base condition is 'and'
f()
 .eq('TypeId', '1')
 .contains(x => x.toLower('Name'), 'a')
 .toString();
// (TypeId eq '1') and (contains(tolower(Name), 'a'))
// there are different constructors for 'and' as base condition
// f(), f('and') and f.and()
f('and')
 .eq('Type/Id', 3)
 .eq(x => x.concat(y => y.concat('City',', '), 'Country', false), 'Berlin, Germany')
 .toString();
// (Type/Id eq 3) and (concat(concat(City, ', '), Country) eq 'Berlin, Germany')

f.or()

ODataFilterBuilder constructor alias. Same as f('or'). Creates a new OData filter builder with 'or' as base condition.

Examples

// 'or' condition as base condition
f('or')
  .eq(x => x.toLower('Name'), 'foo')
  .eq(x => x.toLower('Name'), 'bar')
  .toString();
// (tolower(Name) eq 'foo') or (tolower(Name) eq 'bar')
// combination of 'or' and 'and'
f('or')
  .contains(x => x.toLower('Name'), 'google')
  .contains(x => x.toLower('Name'), 'yandex')
  .and(x => x.eq('Type/Name', 'Search Engine'))
  .toString();
// ((contains(tolower(Name), 'google')) or (contains(tolower(Name), 'yandex'))) and (Type/Name eq 'Search Engine')

More examples

You can find more examples in test/ODataFilterBuilder_spec.js.

To use with AngularJS see http://stackoverflow.com/a/36128276/223750.

Build your copy

Clone repository and use npm scripts

Tests

$ npm test
$ npm run test:watch
$ npm run test:cov
$ npm run lint

Build

$ npm run build

JSDoc

$ npm run jsdoc
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].