# dl-node-mongo

> 针对 `mongodb` 依赖的Api做的二次封装

Latest version **1.0.3** (published 2021-11-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install dl-node-mongo
pnpm add dl-node-mongo
yarn add dl-node-mongo
bun add dl-node-mongo
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-11-24 |
| First published | 2021-11-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | daixiaobin |
| Keywords | node, mongo |

## Links

- npm: https://www.npmjs.com/package/dl-node-mongo
- npm.io page: https://npm.io/package/dl-node-mongo

## Dependencies (1)

- [mongodb](https://npm.io/package/mongodb.md) ^4.2.0

## 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
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2021-11-24
- 1.0.2 — 2021-11-24
- 1.0.1 — 2021-11-24
- 1.0.0 — 2021-11-24

## README

## dl-node-mongo

针对 `mongodb` 依赖的Api做的二次封装

| 名称 | 注释 | 参数 | 返回值 |
| -- | -- | -- | -- |
| findList | 查询列表（无分页） | collectionName, findObj = {}, sortConfig | Array |
| findPage | 查询分页 | collectionName, pagination, findObj = {}, sortConfig | Array |
| findOne | 单项查询 | collectionName, findObj | Object |
| updateOne | 单项更新 | collectionName, updateObj, findObj | -- |
| insertOne | 单项插入 | collectionName, insertObj | -- |
| remove | 单项删除 | collectionName, findObj | -- |
| aggregate | 联表查询 | collectionName, findObj, sortConfig | -- |


+ `collectionName`：数据集的名称
+ `findObj`：查询条件对象
``` javascript
const findObj = {
  id: 1
}
```
+ `pagination`：分页参数对象
``` javascript
const pagination = {
  pageNumber: 1,
  pageSize: 10
}
```
+ `sortConfig`：排序条件对象
``` javascript
const sortConfig = {
  createTime: -1 // -1 倒序 1 正序
}
```
+ `updateObj`：更新的数据对象
+ `insertObj`：插入的数据对象

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