This mongoose (schema) plugin purpose is to generate jsonform supported schemas.
Install via npm
$ npm install mongoose-jsonform
- 0.0.9 Fixed nested path bug (issue #1)
- 0.0.8 Fixed DocumentArray and SchemaArray bug and added example express app
- 0.0.7 added default value option from document (optional)
- 0.0.6 added min,max and include/exclude paths support for number type and update usage example
- 0.0.5 Update files related to test coverage
- 0.0.4 Several fixes to mongoose-jsonform lib + added testcoverage-mocha tests
- 0.0.3 Documentation updates
- 0.0.2 Fixed pacakage.json and update readme
- 0.0.1 First template-release
Optional mongoose-schema parameters for jsonform
Check from here: jsonform-common schema properties
Not supported schema types
- is not unambiguous
- What kind of form this Buffer should be? If you have idea, please let me know.
- Maybe File?
- integer (jsonform support, but mongoose not)
var jsonform = ;var mongoose = ;var Schema = mongooseSchema;var BlogSchema =title: type: String required: true//These keys are just for jsonform. Mongoose not support these keys.title: 'Blog title'description: 'Title for a Blog'maxLength: 100author: Stringbody: Stringcomments: body: String date: Datedate: type: Date default: Datenowhidden: Booleanmeta:votes: Numberfavs: Number;BlogSchema;var Blog = mongoose;var doc = author: 'me';var out = doc;console;
(The MIT License)
Copyright (c) 2013 jussiva <firstname.lastname@example.org>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.