Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/chuanqisun/acs-expression-builder
- Owner: chuanqisun
- License: mit
- Created: 2022-03-16T00:36:57.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-21T17:00:41.000Z (almost 3 years ago)
- Last Synced: 2024-11-07T06:43:03.025Z (about 2 months ago)
- Topics: azure, azure-cognitive-search, azure-search, expression-builder, javascript, odata, typescript
- Language: TypeScript
- Homepage:
- Size: 30.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)