hacken
Version:
Hacken is a node module to help people in hackathons, it has almost all the common features a person needs from database operations to sockets. If you are the one who struglles with MongoDb ObjectId, hacken makes it easier to work with then too.
26 lines (21 loc) • 353 B
JavaScript
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
var room = new Schema({
id:{
type:'string',
required:true
},
messages:[{
username:{
type:'string'
},
text:{
type:'string'
},
time:{
type:'string'
}
}]
});
var model = mongoose.model('chatRoom',room);
module.exports = model;