-
Notifications
You must be signed in to change notification settings - Fork 21
2.3 Models
leonardo Rico edited this page Nov 20, 2017
·
1 revision
Create a file with .js extension in the /src/api/models folder
src/api/models/hello.js
import mongoose from 'mongoose';
const Schema = mongoose.Schema;
const HelloSchema = new Schema({
greet: {
type: String,
required: [true, 'Greet is required.']
},
language: {
type: String,
required: [true, 'Language is required.']
}
});
export default mongoose.model('Hello', HelloSchema);
More info: http://mongoosejs.com/docs/schematypes.html
Nodetomic Api Swagger