@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.
- package/dist/databases/apex.js +2 -1
- package/dist/indexes/apex/index.d.ts +1 -0
- package/dist/indexes/apex/index.js +1 -0
- package/dist/indexes/apex/transactions.d.ts +9 -0
- package/dist/indexes/apex/transactions.js +16 -0
- package/dist/indexes/index.d.ts +2 -0
- package/dist/indexes/index.js +2 -0
- package/dist/indexes/vehicle-events/common.d.ts +3 -0
- package/dist/indexes/vehicle-events/common.js +10 -0
- package/dist/indexes/vehicle-events/index.d.ts +1 -0
- package/dist/indexes/vehicle-events/index.js +1 -0
- package/package.json +1 -1
package/dist/databases/apex.js
CHANGED
|
@@ -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,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';
|