This repository has been archived on 2022-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
brainlet/models/Message.js

12 lines
350 B
JavaScript
Raw Normal View History

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;