0.5.0 • Published 4 years ago

@zcong/mongoose-schema-parser v0.5.0

Weekly downloads
55
License
MIT
Repository
-
Last release
4 years ago

mongoose-schema-parser

NPM version NPM downloads CircleCI codecov

simple mongoose schema parser

Install

$ yarn add @zcong/mongoose-schema-parser

Usage

import { parseSchema } from '@zcong/mongoose-schema-parser'

const testSchema = new Schema({
  id: ObjectId,
  name: String,
  age: {
    type: Number
  }
})

console.log(parseSchema(testSchema))
// {
//   id: {
//     type: {
//       type: TypeEnum.ObjectId,
//       isArray: false
//     }
//   },
//   name: {
//     type: {
//       type: TypeEnum.String,
//       isArray: false
//     }
//   },
//   age: {
//     type: {
//       type: TypeEnum.Number,
//       isArray: false
//     },
//     details: {}
//   }
// }

License

MIT © zcong1993

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.3.1

4 years ago

0.2.0

4 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago