Files
habitica/website/server/models/pushDevice.js
Matteo Pagliazzi 60f34dafb0 Deprecate API v2 (was Revert "Revert "Deprecate API v2"") (#7802)
* Revert "Revert "Deprecate API v2""

* fix path in shops controller
2016-08-01 22:36:10 +02:00

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);