12 lines
350 B
JavaScript
12 lines
350 B
JavaScript
|
const mongoose = require("mongoose");
|
||
|
|
||
|
const messageSchema = new mongoose.Schema({
|
||
|
author: {type: mongoose.Schema.Types.ObjectId, ref: "User"},
|
||
|
channel: {type: mongoose.Schema.Types.ObjectId, ref: "Channel"},
|
||
|
content: String,
|
||
|
createdAt: Number
|
||
|
});
|
||
|
|
||
|
const Message = mongoose.model("Message", messageSchema);
|
||
|
|
||
|
module.exports = Message;
|