mirror of
https://github.com/cnodejs/nodeclub.git
synced 2025-12-08 19:55:55 +00:00
23 lines
525 B
JavaScript
23 lines
525 B
JavaScript
var mongoose = require('mongoose'),
|
|
Schema = mongoose.Schema,
|
|
ObjectId = Schema.ObjectId;
|
|
|
|
/*
|
|
* type:
|
|
* reply: xx 回复了你的话题
|
|
* reply2: xx 在话题中回复了你
|
|
* follow: xx 关注了你
|
|
* at: xx @了你
|
|
*/
|
|
|
|
var MessageSchema = new Schema({
|
|
type: {type: String},
|
|
master_id: {type: ObjectId, index:true},
|
|
author_id: {type: ObjectId},
|
|
topic_id: {type: ObjectId},
|
|
has_read: {type: Boolean, default: false},
|
|
create_at: {type: Date, default: Date.now}
|
|
});
|
|
|
|
mongoose.model('Message', MessageSchema);
|