tBoxOnlineModel.js 713 B

123456789101112131415161718
  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. // t-box在线数据结构 车辆在线可以参考这个表的数据
  7. const TBoxOnlineSchema = new Schema({
  8. _id: { type: String }, // 主键,年月日 + 车辆vin
  9. vin: { type: String }, // 车辆VIN
  10. series_code: { type: String }, // 车系编码
  11. series_name: { type: String }, // 车系名称
  12. online_time: { type: Number }, // TBox上线时间戳
  13. });
  14. TBoxOnlineSchema.index({ online_time: -1 });
  15. TBoxOnlineSchema.index({ online_time: -1, vin: -1 });
  16. return conn.model('TBoxOnline', TBoxOnlineSchema, 't-box_online_info');
  17. };