mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
22 lines
492 B
JavaScript
22 lines
492 B
JavaScript
import mongoose from 'mongoose';
|
|
import baseModel from '../libs/baseModel';
|
|
|
|
const Schema = mongoose.Schema;
|
|
|
|
export let schema = new Schema({
|
|
regId: {type: String, required: true},
|
|
type: {type: String, required: true, enum: ['ios', 'android']},
|
|
}, {
|
|
strict: true,
|
|
minimize: false, // So empty objects are returned
|
|
_id: false,
|
|
});
|
|
|
|
schema.plugin(baseModel, {
|
|
noSet: ['_id', 'regId'],
|
|
timestamps: true,
|
|
_id: false,
|
|
});
|
|
|
|
export let model = mongoose.model('PushDevice', schema);
|