# @sidewinder/query

> Sidewinder Query

Latest version **0.14.0** (published 2024-06-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sidewinder/query
pnpm add @sidewinder/query
yarn add @sidewinder/query
bun add @sidewinder/query
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.14.0 |
| Published | 2024-06-26 |
| First published | 2022-11-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 73 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sinclairzx81 |

## Links

- npm: https://www.npmjs.com/package/@sidewinder/query
- Repository: https://github.com/sinclairzx81/sidewinder
- Homepage: https://github.com/sinclairzx81/sidewinder#readme
- Issues: https://github.com/sinclairzx81/sidewinder/issues
- npm.io page: https://npm.io/package/@sidewinder/query

## Recent versions

- 0.14.0 (latest) — 2024-06-26
- 0.13.1 — 2024-06-05
- 0.13.0 — 2024-05-20
- 0.12.15 — 2023-08-07
- 0.12.14 — 2023-07-16
- 0.12.12 — 2023-07-14
- 0.12.11 — 2023-07-13
- 0.12.10 — 2023-07-12
- 0.12.9 — 2023-07-11
- 0.12.8 — 2023-07-03
- 0.12.7 — 2023-06-21
- 0.12.6 — 2023-06-17
- 0.12.5 — 2023-01-18
- 0.12.4 — 2022-11-28
- 0.12.3 — 2022-11-28
- … 11 more at https://npm.io/package/@sidewinder/query/versions

## README

<div align='center'>

<h1>Sidewinder Query</h1>

<p>Mongo Query Expressions</p>

[<img src="https://img.shields.io/npm/v/@sidewinder/path?label=%40sidewinder%2Fquery">](https://www.npmjs.com/package/@sidewinder/query)

</div>

## Overview

This package provides a query expression syntax for constructing mongo filters from JavaScript like expressions.

```typescript
import { Query } from '@sidewinder/query'

const Q = Query(`
    user_id === '6364ed67a7e953d089dbe23d' && (
        record.name === 'foo' ||
        record.desc === 'bar'
    )
`)

// const Q = {
//   "$and": [
//     {
//       "user_id": "6364ed67a7e953d089dbe23d"
//     },
//     {
//       "$or": [
//         {
//           "record.name": "foo"
//         },
//         {
//           "record.desc": "bar"
//         }
//       ]
//     }
//   ]
// }

const results = await collection.find(Q).toArray()
```

---
_Source: https://npm.io/package/@sidewinder/query · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
