schemas.js 609 B

123456789101112131415161718192021222324252627
  1. /**
  2. * Created by Zhong on 2017/9/28.
  3. */
  4. import mongoose from 'mongoose';
  5. /*
  6. * 此选项设置针对绑定用户,对用户该编办下所有项目有效的全局选项
  7. * */
  8. let Schema = mongoose.Schema;
  9. let optionSchema = new Schema({
  10. user_id: String,
  11. compilation_id: String,
  12. options: {
  13. type: Schema.Types.Mixed,
  14. default: {}
  15. }
  16. }, {versionKey: false});
  17. /*let optionSchema = new Schema({
  18. user_id: String,
  19. compilation_id: String,
  20. options: Array
  21. }, {versionKey: false});*/
  22. let optionsModel = mongoose.model('options', optionSchema);
  23. export default optionsModel;