summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/chart/index.ts6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/chart/index.ts b/src/chart/index.ts
index b59ad7602b..aff30bf0fa 100644
--- a/src/chart/index.ts
+++ b/src/chart/index.ts
@@ -61,11 +61,7 @@ export default abstract class Chart<T> {
constructor(name: string, grouped = false) {
this.collection = db.get<Log<T>>(`chart.${name}`);
- if (grouped) {
- this.collection.createIndex({ span: -1, date: -1, group: -1 }, { unique: true });
- } else {
- this.collection.createIndex({ span: -1, date: -1 }, { unique: true });
- }
+ this.collection.createIndex({ span: -1, date: -1, group: grouped ? -1 : undefined }, { unique: true });
}
@autobind