# mongoose-client

> A mongoose client to make mongo CRUD convenient.

Latest version **1.1.0** (published 2018-04-02) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install mongoose-client
pnpm add mongoose-client
yarn add mongoose-client
bun add mongoose-client
```

## 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.1.0 |
| Published | 2018-04-02 |
| First published | 2017-10-14 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 (+11 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | njhxzhangjh@gmail.com |
| Maintainers | jhspider |
| Keywords | mongoose, mongodb, client |

## Links

- npm: https://www.npmjs.com/package/mongoose-client
- Repository: https://github.com/zhangjh/mongoose-client
- Homepage: https://github.com/zhangjh/mongoose-client#readme
- Issues: https://github.com/zhangjh/mongoose-client/issues
- npm.io page: https://npm.io/package/mongoose-client

## Dependencies (1)

- [mongoose](https://npm.io/package/mongoose.md) ^4.12.1

## 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.1.0 (latest) — 2018-04-02
- 1.0.9 — 2017-10-19
- 1.0.8 — 2017-10-19
- 1.0.7 — 2017-10-16
- 1.0.6 — 2017-10-14
- 1.0.5 — 2017-10-14
- 1.0.4 — 2017-10-14
- 1.0.3 — 2017-10-14
- 1.0.2 — 2017-10-14
- 1.0.1 — 2017-10-14
- 1.0.0 — 2017-10-14

## README

# mongoose-client
 A mongoose client to make mongo CRUD convenient.
 
 # Install 
 `npm install mongoose-client`
 
 # Usage 
 ## 1. require mongoose-client
 ```
 var mongooseClient = require("mongoose-client");
 ```
 ## 2. Modify config
 You must modify the configuration to your owns.
 So you can do it like this:
 ```js
    var mongooseClientInstance = new mongooseClient({
      DB_IP: "xxx",
      DB_PORT: "xxx",
      DB_NAME: "xxx",
      schema: {
        collection1: {
          key1: {type: String},
          key2: {type: String}
        },
        collection2: {
          key1: {type: String},
          key2: {type: JSON},
          key3: {type: Array}
        },
        ... 
      }
    });
 ```
 
 ## 3. Use it
 ```js
 // insert:
 mongooseClientInstance.insert(collection,data,callback);
 
 // remove:
 mongooseClientInstance.remove(collection,removeCondition,callback);
 
 // update:
 mongooseClientInstance.update(collection,updateCondition,update,options,callback);
 
 // find: (sortMode is optional and default as {}, it also can be any other field such as {_id: -1} indicate results sorted by _id descrease)
 mongooseClientInstance.find(collection,findPattern,callback,sortMode);
 
 // find batch:(findPatern can be regular expression)
  mongooseClientInstance.findBatch(collection,findPattern,callback,sortMode);

All callbacks return result as:
{
	success: true/false,
	data: xxx,              // if success is true
	msg: xxx		        // if success is false
}	
 ```

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