Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chuanqisun/acs-expression-builder

JavaScript Toolkit for Azure Cognitive Search Service
https://github.com/chuanqisun/acs-expression-builder

azure azure-cognitive-search azure-search expression-builder javascript odata typescript

Last synced: about 1 month ago
JSON representation

JavaScript Toolkit for Azure Cognitive Search Service

Awesome Lists containing this project

README

        

# ACS Expression Builder

An OData Filter Expression Builder for Azure Cognitive Search.

Supports

- [$filter](https://docs.microsoft.com/en-us/azure/search/search-query-odata-filter)
- [$orderBy](https://docs.microsoft.com/en-us/azure/search/search-query-odata-orderby) (future)
- [$select](https://docs.microsoft.com/en-us/azure/search/search-query-odata-select) (future)

## Get started

```bash
npm i acs-expression-builder
```

```javascript
import { field, ifAny } from "acs-expression-builder";

const exp = field("foo").any((item) => ifAny([item().eq("x"), item().eq("y")]));
console.log(exp.toString()); // foo/any(i: i eq 'x' or i eq 'y')
```

## Documentation

This project uses [test specs as documentation](./src/__tests__/filter-expression-builder.spec.ts)