mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-01 23:55:58 +09:00
Merge branch 'develop' of https://github.com/syuilo/misskey into develop
This commit is contained in:
commit
1c589c7c18
@ -61,11 +61,13 @@ export default abstract class Chart<T> {
|
|||||||
|
|
||||||
constructor(name: string, grouped = false) {
|
constructor(name: string, grouped = false) {
|
||||||
this.collection = db.get<Log<T>>(`chart.${name}`);
|
this.collection = db.get<Log<T>>(`chart.${name}`);
|
||||||
if (grouped) {
|
const keys = {
|
||||||
this.collection.createIndex({ span: -1, date: -1, group: -1 }, { unique: true });
|
span: -1,
|
||||||
} else {
|
date: -1
|
||||||
this.collection.createIndex({ span: -1, date: -1 }, { unique: true });
|
};
|
||||||
}
|
if (grouped)
|
||||||
|
keys.group = -1;
|
||||||
|
this.collection.createIndex(keys, { unique: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
Loading…
Reference in New Issue
Block a user