I have a problem to store data in mongoDb,
This is my model:
module.exports = function(app) {
var collection = 'chat_user';
var Schema = app.mongoose.Schema;
var schema = new Schema({
user_id: String,
ws: Object
}, { collection: collection });
this.model = app.db.model(collection, schema);
return this;
};
But when I'm trying to store :
chat.user = new models.chat_user({
user_id: app.locals.session.user._id,
ws: ws
})
console.log(chat.user)
chat.user.save();
The console.log return the good result but I have nothing in my database, maybe the object si too big ?
If I remove it my object_id is store in my db
Thanks