# mongoc

> compile mongo queries into javascript functions

Latest version **0.1.1** (published 2014-01-17) · 0 weekly downloads

## Install

```sh
npm install mongoc
pnpm add mongoc
yarn add mongoc
bun add mongoc
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2014-01-17 |
| First published | 2012-11-04 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Mathias Buus Madsen |
| Maintainers | mafintosh |
| Keywords | query, mongo, mongodb |

## Links

- npm: https://www.npmjs.com/package/mongoc
- Repository: https://github.com/mafintosh/mongoc
- Issues: https://github.com/mafintosh/mongoc/issues
- npm.io page: https://npm.io/package/mongoc

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2014-01-17
- 0.1.0 — 2012-11-04

## README

# mongoc

Mongoc lets you compile mongodb queries into Javascript functions that returns true if the query fits the input

It's available through npm:

	npm install mongoc

It's easy to use

``` js
var mongoc = require('mongoc');

var query = mongoc({
	hello:'world',
	time:{
		$gt:10,
		$lt:20
	}
});

console.log(query({hello:world, time:14})) // prints true;
```

You can use the query to filter an array

``` js
var query = mongoc({
	hello:{$in:['world','mondo']}
});

console.log([{hello:'world'},{hello:'verden'},{hello:'mondo'},{hello:'welt'}].filter(query));
```

For a complete reference of the query language see [the mongo docs](http://www.mongodb.org/display/DOCS/Advanced+Queries)

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