Add user model
This commit is contained in:
parent
61467f2f8a
commit
06a9e3dec5
|
@ -0,0 +1,29 @@
|
|||
import mongoose from 'mongoose';
|
||||
|
||||
const user = {
|
||||
id: {
|
||||
type: Number,
|
||||
required: true,
|
||||
trim: true,
|
||||
},
|
||||
city: {
|
||||
id: {
|
||||
type: Number,
|
||||
required: false,
|
||||
trim: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: false,
|
||||
trim: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const userSchema = mongoose.Schema(user, {
|
||||
collection: 'umbrello_users',
|
||||
});
|
||||
|
||||
const User = mongoose.model('user', userSchema);
|
||||
|
||||
export default User;
|
Loading…
Reference in New Issue