chatstorm
Version:
ChatStorm - Real-Time Chat Server for Your App. ChatStorm is a powerful, lightning-fast Socket.io-based chat server that enables seamless real-time messaging in your application. Whether you're building a messaging app, live chat feature, or a collaborati
27 lines (22 loc) • 413 B
JavaScript
const mongoose = require("mongoose");
const socketSchema = mongoose.Schema(
{
user: {
type: mongoose.Schema.Types.ObjectId,
ref: "User",
required: true,
},
isOnline: {
type: Boolean,
default: false,
},
socket: {
type: String,
},
},
{
timestamps: true,
}
);
const Socket = mongoose.model("socket", socketSchema);
module.exports = Socket;