Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed unsed variables and required files
- Loading branch information
shrikant
committed
Oct 21, 2019
1 parent
84dfc67
commit e38b17e
Showing
3 changed files
with
52 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
var util = require('util'); | ||
var mongoose = require('mongoose'); | ||
var Schema = mongoose.Schema; | ||
//定义article type实体对象模型 | ||
var articleTypeScheme = new Schema({ | ||
articleType:String | ||
,describe:String | ||
,logoSrc:String | ||
articleType: String, | ||
describe: String, | ||
logoSrc: String | ||
//,create_date: { type: Date, default: Date.now } | ||
}); | ||
//定义article details对象模型 | ||
var articleDetailScheme = new Schema({ | ||
title:String | ||
,summary:String | ||
,content:String | ||
,create_date: { type: Date, default: Date.now } | ||
,refArticleId:{ type: Schema.Types.ObjectId, ref: 'articleType' } | ||
title: String, | ||
summary: String, | ||
content: String, | ||
create_date: { | ||
type: Date, | ||
default: Date.now | ||
}, | ||
refArticleId: { | ||
type: Schema.Types.ObjectId, | ||
ref: 'articleType' | ||
} | ||
|
||
}); | ||
mongoose.model('articleType', articleTypeScheme); | ||
mongoose.model('articleDetail', articleDetailScheme); | ||
module.exports.Schema =function (modelName){ | ||
return{model:mongoose.model(modelName)}; | ||
} | ||
module.exports.Schema = function (modelName) { | ||
return { | ||
model: mongoose.model(modelName) | ||
}; | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
var util = require('util'); | ||
var mongoose = require('mongoose'); | ||
var Schema = mongoose.Schema; | ||
var userSchema = new Schema({ | ||
userName:String, | ||
password:String, | ||
email:String, | ||
create_date: { type: Date, default: Date.now } | ||
userName: String, | ||
password: String, | ||
email: String, | ||
create_date: { | ||
type: Date, | ||
default: Date.now | ||
} | ||
}); | ||
//访问todo对象模型 | ||
mongoose.model('user', userSchema); | ||
module.exports.Schema =function (modelName){ | ||
return{model:mongoose.model(modelName)}; | ||
} | ||
module.exports.Schema = function (modelName) { | ||
return { | ||
model: mongoose.model(modelName) | ||
}; | ||
} |