1 | # mongoose-helper
|
2 |
|
3 | [![version][0]][1] [![downloads][2]][3]
|
4 |
|
5 | mongoose-helper 提供标准的 mongoose 方法。
|
6 |
|
7 | 我们定义了:
|
8 |
|
9 | 1. [标准的 query in url 格式](../tpl-service/README.md##QueryInRoute).
|
10 | 2. [标准的 service 层 Query 数据格式](../tpl-service/README.md##QueryInService).
|
11 |
|
12 | mongoose-helper 的 `list` 方法中将会进一步将 `QueryInService` 转成成适合 mongoose 查询的语法。
|
13 |
|
14 | ## Install
|
15 |
|
16 | ```bash
|
17 | yarn add mongoose-helper
|
18 | ```
|
19 |
|
20 | ## Usage
|
21 |
|
22 | ```js
|
23 | import helper from ("mongoose-helper");
|
24 |
|
25 | // mongoose schema
|
26 | schema.plugin(helper, options);
|
27 | ```
|
28 |
|
29 | ## Query Standard
|
30 |
|
31 | 我们制定了一套前端的 query 语法标准。请参考:
|
32 |
|
33 | [Read the document of tpl-service.](../tpl-service/README.md##Routes)
|
34 |
|
35 | ## Contributing
|
36 |
|
37 | 1. Fork it!
|
38 | 2. Create your feature branch: `git checkout -b my-new-feature`
|
39 | 3. Commit your changes: `git commit -am 'Add some feature'`
|
40 | 4. Push to the branch: `git push origin my-new-feature`
|
41 | 5. Submit a pull request :D
|
42 |
|
43 | ## Author
|
44 |
|
45 | **mongoose-helper** © [36node](https://github.com/36node), Released under the [MIT](./LICENSE) License.
|
46 |
|
47 | Authored and maintained by 36node with help from contributors ([list](https://github.com/36node/mongoose-helper/contributors)).
|
48 |
|
49 | > [github.com/zzswang](https://github.com/zzswang) · GitHub [@36node](https://github.com/36node)
|
50 |
|
51 | [0]: https://img.shields.io/npm/v/@36node/mongoose-helper.svg?style=flat
|
52 | [1]: https://npmjs.com/package/@36node/mongoose-helper
|
53 | [2]: https://img.shields.io/npm/dm/@36node/mongoose-helper.svg?style=flat
|
54 | [3]: https://npmjs.com/package/@36node/mongoose-helper
|