appExceptionRecordModel.js 707 B

1234567891011121314151617
  1. 'use strict';
  2. module.exports = app => {
  3. const mongoose = app.mongoose;
  4. const Schema = mongoose.Schema;
  5. const conn = app.mongooseDB.get('etlDB');
  6. // APP异常数据结构
  7. const AppExceptionRecordSchema = new Schema({
  8. _id: { type: String }, // 日月年拼接
  9. exception_type: { type: Number }, // 异常类型(系统异常/功能异常)
  10. sys_count: { type: Number }, // 系统异常总数
  11. create_time: { type: Number }, // 统计时间(时间戳)
  12. interface_exception_count: { type: Number }, // 接口异常总数
  13. });
  14. AppExceptionRecordSchema.index({ create_time: -1 });
  15. return conn.model('AppExceptionRecord', AppExceptionRecordSchema, 'app_exception_record');
  16. };