This commit is contained in:
syuilo 2018-11-12 06:12:22 +09:00
parent a9cfbda858
commit c84500d914
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69

View file

@ -66,19 +66,6 @@ export default abstract class Chart<T> {
} else { } else {
this.collection.createIndex({ span: -1, date: -1 }, { unique: true }); this.collection.createIndex({ span: -1, date: -1 }, { unique: true });
} }
//#region 後方互換性のため
this.collection.find({ span: 'day' }, { fields: { _id: true, date: true } }).then(logs => {
logs.forEach(log => {
this.collection.update({ _id: log._id }, { $set: { date: utc(log.date).hour(0).toDate() } });
});
});
this.collection.find({ span: 'hour' }, { fields: { _id: true, date: true } }).then(logs => {
logs.forEach(log => {
this.collection.update({ _id: log._id }, { $set: { date: utc(log.date).toDate() } });
});
});
//#endregion
} }
@autobind @autobind