service-privateroom
This commit is contained in:
parent
bc6aa6dd28
commit
c00d9ba51d
8 changed files with 264 additions and 0 deletions
22
backend/service-privateroom/models/Conversation.js
Normal file
22
backend/service-privateroom/models/Conversation.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
const mongoose = require("mongoose");
|
||||
const config = require("../config");
|
||||
|
||||
const url = config.mongodbHost+config.mongodbDatabase;
|
||||
|
||||
mongoose.connect(url,({useNewUrlParser: true, useUnifiedTopology: true})).then( function(){
|
||||
console.log('mongodb-conversation connected '+mongoose.connection.readyState);
|
||||
}).catch(function(err){
|
||||
console.log('error : '+err);
|
||||
});
|
||||
|
||||
const ConversationSchema = new mongoose.Schema(
|
||||
{
|
||||
members: {
|
||||
type: Array
|
||||
},
|
||||
},
|
||||
{ timestamps: true },
|
||||
{ versionKey: false }
|
||||
);
|
||||
|
||||
module.exports = mongoose.model(config.mongodbConversations, ConversationSchema);
|
||||
Reference in a new issue