Spaces:
Running

File size: 394 Bytes
71601b1
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
const mongoose = require('mongoose');

const ActionSchema = new mongoose.Schema({
    user: { type: String, index: true },
    contact: { type: String, index: true },
    type: { type: String, enum: ['pin', 'archive', 'mute'] }
});

ActionSchema.index({ user: 1, contact: 1 });
ActionSchema.index({ user: 1, contact: 1, type: 1 });

module.exports = mongoose.model('ChatAction', ActionSchema);