Footprint Server Schema

定义“足迹”模式

字段 类型 是否必须 备注
createdAt Date() true 添加到数据库的时间,默认生成
time Number() false
type Number() true 足迹类型
activityInfo undefined false 动态
messageBoardReply undefined false 回复留言
commentPost undefined false 帖子评论
commentReply undefined false 回复评论
starJourney undefined false 明星行程
blogReply undefined false 微博回复
online undefined false 上线信息
var footprintSchema = {
        // 添加到数据库的时间,默认生成
        createdAt: {
            type: Date,
            required: true,
            default: Date.now
        },
        time: Number,
        // 足迹类型
        type: {
            type: Number,
            required: true
        },
        // 动态
        activityInfo: {
            activity: {
                type: mongoose.Schema.Types.ObjectId,
                ref: 'Activity'
            },
            publisher: {
                type: mongoose.Schema.Types.ObjectId,
                ref: 'User'
            }
        },
        // 回复留言
        messageBoardReply: {
            time: Number,
            landlordReply: String,
            publisher: {
                type: mongoose.Schema.Types.ObjectId,
                ref: 'User'
            }
        },
        // 帖子评论
        commentPost: {
            time: Number,
            content: String,
            postId: {
                type: mongoose.Schema.Types.ObjectId,
                ref: 'Activity'
            },
            publisher: {
                type: mongoose.Schema.Types.ObjectId,
                ref: 'User'
            }
        },
        // 回复评论
        commentReply: {
            time: Number,
            landlordReply: String,
            postId: {
                type: mongoose.Schema.Types.ObjectId,
                ref: 'Activity'
            },
            publisher: {
                type: mongoose.Schema.Types.ObjectId,
                ref: 'User'
            }
        },
        // 明星行程
        starJourney: {
            time: Number,
            title: String,
            content: String,
            coverImageUrl: String,
            newsId: {
                type: mongoose.Schema.Types.ObjectId,
                ref: 'News'
            }
        },
        // 微博回复
        blogReply: {
            time: Number,
            title: String,
            content: String,
            coverImageUrl: String,
            newsId: {
                type: mongoose.Schema.Types.ObjectId,
                ref: 'News'
            }
        },
        online: {
            time: Number,
            title: String
        }
    };
最后更新于 27th Nov 2018