12345678910111213141516171819 |
- 'use strict';
- module.exports = app => {
- const mongoose = app.mongoose;
- const Schema = mongoose.Schema;
- const conn = app.mongooseDB.get('etlDB');
- // IVI用户行为埋点,类似APP行为埋点 联合驾驶行为集合统计听歌,听新闻等行程
- const IviBehaviorRecordSchema = new Schema({
- _id: { type: String }, // vin+behavior_id+ 日月年+序列号
- user_id: { type: String }, // IVI用户ID
- vin: { type: String }, // 车辆VIN
- behavior_id: { type: Number }, // 行为ID 听歌20020001,听电台20010001,看新闻20050001,看视频 20030001
- create_time: { type: Number }, // 行为开始时间
- });
- IviBehaviorRecordSchema.index({ create_time: -1 });
- IviBehaviorRecordSchema.index({ create_time: -1, vin: -1 });
- return conn.model('IviBehaviorRecord', IviBehaviorRecordSchema, 'ivi_behavior_record');
- };
|