Created
November 25, 2013 14:24
-
-
Save nidhhoggr/7641919 to your computer and use it in GitHub Desktop.
Test schema modification suggestion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In order for Fieldset to have an objectId should something like the following exist: | |
var Fieldset = module.exports = new Schema({ | |
name: { type: String, required: true }, | |
key: { type: String, required: true }, | |
repeatable: { type: Boolean, default: false }, | |
ordinal: { type: Number } | |
}); | |
var Test = module.exports = new Schema({ | |
name: { type: String, required: true, index: { unique: true } }, | |
key: { type: String, required: true }, | |
abbreviation: { type: String, required: false }, | |
unit: { type: ObjectId, required: false, ref: 'Unit' }, | |
parent: { type: ObjectId, required: false, ref: 'Test' }, | |
states: [{ type: String, required: false }], | |
companies: [{ type: ObjectId, required: false, ref: 'Company' }], | |
ordinal: { type: Number }, | |
deleted: { type: Boolean, default: false }, | |
fieldsets: [Fieldset], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment