@tmlmobilidade/go-interfaces-rawdb 20260724.1853.53 → 20260725.1241.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  /* * */
2
+ import { transactionsIndexes } from '../indexes/apex/transactions.js';
2
3
  import { MongoInterfaceTemplate } from '../interface.template.js';
3
4
  import { RawApexTransactionSchema } from '@tmlmobilidade/go-types-apex';
4
5
  /* * */
@@ -11,6 +12,6 @@ export class ApexDatabase {
11
12
  // Create the database instance
12
13
  this.database = instance.db(this.databaseName);
13
14
  // Create collection interfaces
14
- this.transactions = new MongoInterfaceTemplate('transactions', this.database, RawApexTransactionSchema);
15
+ this.transactions = new MongoInterfaceTemplate('transactions', this.database, RawApexTransactionSchema, transactionsIndexes);
15
16
  }
16
17
  }
@@ -0,0 +1 @@
1
+ export * from './transactions.js';
@@ -0,0 +1 @@
1
+ export * from './transactions.js';
@@ -0,0 +1,9 @@
1
+ import { type SimplifiedMongoIndex } from '@tmlmobilidade/go-clients-mongo';
2
+ import { type RawApexTransaction } from '@tmlmobilidade/go-types-apex';
3
+ /**
4
+ * **IMPORTANT**:
5
+ * Automatic sorting (ESLint) of keys in the JS objects should be disabled.
6
+ * The order of keys in a compound index is very important and should be
7
+ * carefully considered based on the cardinality of each key.
8
+ */
9
+ export declare const transactionsIndexes: SimplifiedMongoIndex<RawApexTransaction>[];
@@ -0,0 +1,16 @@
1
+ /* * */
2
+ /* * */
3
+ /**
4
+ * **IMPORTANT**:
5
+ * Automatic sorting (ESLint) of keys in the JS objects should be disabled.
6
+ * The order of keys in a compound index is very important and should be
7
+ * carefully considered based on the cardinality of each key.
8
+ */
9
+ export const transactionsIndexes = [
10
+ { key: { created_at: 1 } },
11
+ { key: { agency_id: 1, created_at: 1 } },
12
+ // eslint-disable-next-line perfectionist/sort-objects
13
+ { key: { version_id: 1, created_at: 1 } },
14
+ // eslint-disable-next-line perfectionist/sort-objects
15
+ { key: { version_id: 1, received_at: 1 } },
16
+ ];
@@ -0,0 +1,2 @@
1
+ export * from './apex/index.js';
2
+ export * from './vehicle-events/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './apex/index.js';
2
+ export * from './vehicle-events/index.js';
@@ -0,0 +1,3 @@
1
+ import { type SimplifiedMongoIndex } from '@tmlmobilidade/go-clients-mongo';
2
+ import { type RawVehicleEvent } from '@tmlmobilidade/go-types-vehicle-events';
3
+ export declare const vehicleEventsIndexes: SimplifiedMongoIndex<RawVehicleEvent>[];
@@ -0,0 +1,10 @@
1
+ /* * */
2
+ /* * */
3
+ export const vehicleEventsIndexes = [
4
+ { key: { created_at: 1 } },
5
+ { key: { agency_id: 1, created_at: 1 } },
6
+ // eslint-disable-next-line perfectionist/sort-objects
7
+ { key: { version_id: 1, created_at: 1 } },
8
+ // eslint-disable-next-line perfectionist/sort-objects
9
+ { key: { version_id: 1, received_at: 1 } },
10
+ ];
@@ -0,0 +1 @@
1
+ export * from './common.js';
@@ -0,0 +1 @@
1
+ export * from './common.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/go-interfaces-rawdb",
3
- "version": "20260724.1853.53",
3
+ "version": "20260725.1241.26",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"