import mongoose from 'mongoose'; import MaterialModel from './material'; import NoteModel from './note'; import UserModel from './user'; const SampleSchema = new mongoose.Schema({ number: {type: String, index: {unique: true}}, type: String, color: String, batch: String, material_id: {type: mongoose.Schema.Types.ObjectId, ref: MaterialModel}, note_id: {type: mongoose.Schema.Types.ObjectId, ref: NoteModel}, user_id: {type: mongoose.Schema.Types.ObjectId, ref: UserModel}, status: Number }); export default mongoose.model('sample', SampleSchema);