Browse Source

feat: Add gps_data field to the stored data

master
Konstantinos Kamaropoulos 5 years ago
parent
commit
748679e1fc
  1. 1
      src/logs/logs.interface.ts
  2. 1
      src/logs/logs.service.ts
  3. 1
      src/schemas/logs.schema.ts

1
src/logs/logs.interface.ts

@ -4,6 +4,7 @@ export interface ILogs {
_id?: number;
drone_id: number;
gprmc: String;
gps_data: Object;
sensorReadings: Object;
createdAt?: Date;
updatedAt?: Date;

1
src/logs/logs.service.ts

@ -18,6 +18,7 @@ export class LogsService {
const storedLog = new this.logsModel({
drone_id: data["id"],
gprmc: data["GPRMC"],
gps_data: data["gps_data"],
sensorReadings: data["sensorReadings"]
});
let id = await storedLog.save();

1
src/schemas/logs.schema.ts

@ -3,5 +3,6 @@ import * as mongoose from 'mongoose';
export const LogsSchema = new mongoose.Schema({
drone_id: { type: Number },
gprmc: { type: String },
gps_data: { type: Object },
sensorReadings: { type: Object }
}, { timestamps: true });

Loading…
Cancel
Save