# node-dao

> node.js mongo-like data access object interface

Latest version **0.8.2** (published 2019-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-dao
pnpm add node-dao
yarn add node-dao
bun add node-dao
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.2 |
| Published | 2019-07-02 |
| First published | 2017-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 57.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Igor F145h Savchenko |
| Maintainers | f145h |

## Links

- npm: https://www.npmjs.com/package/node-dao
- Repository: https://github.com/F145h/node-dao
- Homepage: https://github.com/F145h/node-dao#readme
- Issues: https://github.com/F145h/node-dao/issues
- npm.io page: https://npm.io/package/node-dao

## Recent versions

- 0.8.2 (latest) — 2019-07-02
- 0.8.1 — 2018-09-17
- 0.8.0 — 2018-08-29
- 0.7.6 — 2018-08-25
- 0.7.5 — 2018-07-20
- 0.7.4 — 2018-07-20
- 0.7.3 — 2018-03-29
- 0.7.2 — 2018-03-29
- 0.7.1 — 2018-01-10
- 0.7.0 — 2018-01-10
- 0.6.1 — 2017-12-15
- 0.6.0 — 2017-12-14
- 0.5.6 — 2017-12-13
- 0.5.5 — 2017-12-13
- 0.5.2 — 2017-12-13
- … 4 more at https://npm.io/package/node-dao/versions

## README

# node-dao

Node-Dao - Simple MongoDb-like interface to MySql, PostgreSql, SqlLite and Mongo databases




look like this:
```js

var rsa = await daoConnection.find({}).limit(2).sort({ name: 1 }).toArray();

```



find method samples: 

```js

find({value: {$gte: 25}})

find({value: {$ne: 4}})

find({age: {$gt: 20, $lt:10}})

find({age: {$gt: 20, $lt:10}})

find({age: {$gt: 20}, name: {$eq: “jenny”}});

```
so, dao request 

```js
find({name: {$eq: “john”}}).limit(1).sort({time: -1}).limit(1).toArray();
```

will be translated for MySQL  like that

```js
SELECT * FROM messages WHERE name = “john” ORDER BY name DESC LIMIT 1 OFFSET 1;
```

If you call count() instread toArray() then the request will be generated as:

```js
SELECT count(*) FROM messages WHERE name = “john” LIMIT 1 OFFSET 1;
```

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