bucket:使用Mongoose的便捷CRUD方法

时间:2021-02-03 13:30:28
【文件属性】:
文件名称:bucket:使用Mongoose的便捷CRUD方法
文件大小:81KB
文件格式:ZIP
更新时间:2021-02-03 13:30:28
library mongodb mongoose repository-pattern MongooseTypeScript 桶 Bucket是对猫鼬的模式的实现 如何安装 yarn add @random-guys/bucket 要么 npm install @random-guys/bucket 它是如何工作的 铲斗由3部分组成。 定义模型属性的接口,定义基本操作和查询以及自定义操作的存储库,以及用于帮助类型转换和验证输入的架构。 快速开始 定义模型的属性 import { Model } from "@random-guys/bucket" ; export interface Book extends Model { isbn : string ; title : string ; version : Version ; } export interface Version { major : number ; minor : number ; patch : number ; } Model只是猫鼬Document的扩展,它支持时间戳以及基于字符串(UUID)的ID _id。 然后使用和自定义模式为您的数据定义一个模式 import { SchemaTypes , Sc
【文件预览】:
bucket-master
----bin()
--------migrate.js(1KB)
----package.json(1KB)
----__tests__()
--------sample.spec.ts(46B)
----.prettierrc(77B)
----jest.config.js(260B)
----src()
--------migration.ts(2KB)
--------utils.schema.ts(2KB)
--------errors.ts(471B)
--------query.ts(1KB)
--------connect.ts(707B)
--------index.ts(229B)
--------base.repo.ts(10KB)
--------base.model.ts(143B)
--------base.schema.ts(1KB)
----tsconfig.json(514B)
----samples()
--------sample-migration.ts(497B)
--------migrate-mongo-config.js(520B)
----.gitignore(61B)
----.circleci()
--------config.yml(3KB)
----README.md(2KB)
----yarn.lock(174KB)

网友评论