monsqlize 2.0.2 → 2.0.4
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/CHANGELOG.md +13 -5
- package/README.md +66 -20
- package/changelogs/README.md +8 -4
- package/changelogs/v2.0.0.md +1 -1
- package/changelogs/v2.0.3.md +58 -0
- package/changelogs/v2.0.4.md +61 -0
- package/dist/cjs/index.cjs +911 -213
- package/dist/cjs/transaction/Transaction.cjs +88 -3
- package/dist/cjs/transaction/TransactionManager.cjs +135 -11
- package/dist/esm/index.mjs +906 -208
- package/dist/types/collection.d.ts +5 -3
- package/dist/types/model.d.ts +279 -175
- package/dist/types/mongodb.d.ts +8 -1
- package/dist/types/monsqlize.d.ts +37 -4
- package/dist/types/pool.d.ts +1 -1
- package/dist/types/runtime.d.ts +33 -8
- package/dist/types/transaction.d.ts +12 -0
- package/package.json +23 -22
|
@@ -34,6 +34,8 @@ export interface TotalsInfo {
|
|
|
34
34
|
token?: string;
|
|
35
35
|
/** Write timestamp (ms) if from cache */
|
|
36
36
|
ts?: number;
|
|
37
|
+
/** True when an approximate totals strategy was used */
|
|
38
|
+
approx?: boolean;
|
|
37
39
|
/** Error identifier for async mode failures */
|
|
38
40
|
error?: string;
|
|
39
41
|
}
|
|
@@ -98,9 +100,9 @@ export interface OffsetJumpOptions {
|
|
|
98
100
|
export interface TotalsOptions {
|
|
99
101
|
/** Counting strategy (default 'none') */
|
|
100
102
|
mode?: 'none' | 'async' | 'approx' | 'sync';
|
|
101
|
-
/** Timeout for countDocuments
|
|
103
|
+
/** Timeout for countDocuments / estimatedDocumentCount (ms) */
|
|
102
104
|
maxTimeMS?: number;
|
|
103
|
-
/** Cache TTL for totals (
|
|
105
|
+
/** Cache TTL for totals (ms; default 10 min) */
|
|
104
106
|
ttlMs?: number;
|
|
105
107
|
/** Index hint for count query */
|
|
106
108
|
hint?: unknown;
|
|
@@ -220,7 +222,7 @@ export interface FindPageOptions<TSchema = any> {
|
|
|
220
222
|
hint?: Document | string;
|
|
221
223
|
collation?: Document;
|
|
222
224
|
batchSize?: number;
|
|
223
|
-
/** Cache TTL in milliseconds */
|
|
225
|
+
/** Cache TTL in milliseconds for the non-stream/non-explain page result */
|
|
224
226
|
cache?: number;
|
|
225
227
|
/** Include timing/meta info in result — pass true or MetaOptions for sub-step detail */
|
|
226
228
|
meta?: boolean | MetaOptions;
|