Add index for Asset ID in Consumptions
MODIFY
src/storage/mongodb/MongoDBStorage.ts
src/storage/mongodb/MongoDBStorage.ts
@@ -136,6 +136,7 @@ export default class MongoDBStorage {
]);
await this.handleIndexesInCollection(collections, tenantID, 'consumptions', [
{ fields: { transactionId: 1 } },
+ { fields: { assetID: 1, startedAt: 1 } },
{ fields: { siteAreaID: 1, startedAt: 1 } }
]);
// Companies

Add index for Asset ID in Consumptions