monsqlize 3.1.14 → 3.3.0
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 +8 -2
- package/README.md +25 -1
- package/changelogs/v3.2.0.md +24 -0
- package/changelogs/v3.3.0.md +29 -0
- package/dist/cjs/cli/data-task.cjs +13 -2
- package/dist/cjs/index.cjs +701 -58
- package/dist/cjs/transaction/Transaction.cjs +8 -0
- package/dist/cjs/transaction/TransactionManager.cjs +8 -0
- package/dist/esm/index.mjs +702 -58
- package/dist/types/aggregation.d.mts +58 -0
- package/dist/types/aggregation.d.ts +58 -0
- package/dist/types/base.d.mts +4 -0
- package/dist/types/base.d.ts +4 -0
- package/dist/types/collection.d.mts +20 -20
- package/dist/types/collection.d.ts +20 -20
- package/dist/types/model.d.mts +126 -1
- package/dist/types/model.d.ts +126 -1
- package/dist/types/monsqlize.d.mts +28 -9
- package/dist/types/monsqlize.d.ts +28 -9
- package/dist/types/runtime.d.mts +7 -1
- package/dist/types/runtime.d.ts +7 -1
- package/licenses/production-dependencies.json +1 -1
- package/package.json +13 -2
|
@@ -35,7 +35,7 @@ export interface SSHConfig {
|
|
|
35
35
|
import type { Collection, CursorValueNormalizer, CursorValueType, DbAccessor, HealthView } from './collection.mjs';
|
|
36
36
|
import type { DataTaskJobError } from './data-tasks.mjs';
|
|
37
37
|
import type { Lock, LockOptions, LockStats } from './lock.mjs';
|
|
38
|
-
import type { ModelAutoIndexOptions, ModelEnsureAllIndexesOptions, ModelIndexEnsureSummary, ModelInstance } from './model.mjs';
|
|
38
|
+
import type { ModelAutoIndexOptions, ModelDescriptor, ModelEnsureAllIndexesOptions, ModelIndexEnsureSummary, ModelInstance } from './model.mjs';
|
|
39
39
|
import type { MongoConnectConfig } from './mongodb.mjs';
|
|
40
40
|
import type { ConnectionPoolManagerOptions, PoolConfig, PoolHealthStatus, PoolStats, PoolStrategy } from './pool.mjs';
|
|
41
41
|
import type {
|
|
@@ -70,6 +70,15 @@ import type { SlowQueryLogConfigInput, SlowQueryLogEntry, SlowQueryLogFilter, Sl
|
|
|
70
70
|
import type { ChangeStreamSyncManager, SyncConfig, SyncStats } from './sync.mjs';
|
|
71
71
|
import type { Transaction, TransactionOptions, TransactionStats } from './transaction.mjs';
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Callable model accessor that preserves a descriptor's inferred document type.
|
|
75
|
+
* @since v3.3.0
|
|
76
|
+
*/
|
|
77
|
+
export interface ModelBindingAccessor {
|
|
78
|
+
<TDocument>(descriptor: ModelDescriptor<string, TDocument>): ModelInstance<TDocument>;
|
|
79
|
+
<TDocument = any>(modelName: string): ModelInstance<TDocument>;
|
|
80
|
+
}
|
|
81
|
+
|
|
73
82
|
/** Write path policy mode. `allow-both` preserves the existing collection and model write behavior. */
|
|
74
83
|
export type WritePathPolicyMode = 'allow-both' | 'model-only';
|
|
75
84
|
|
|
@@ -283,7 +292,7 @@ export interface MonSQLizeInstance {
|
|
|
283
292
|
db: (name?: string) => DbAccessor;
|
|
284
293
|
use: (name: string) => {
|
|
285
294
|
collection: <TSchema = any>(collectionName: string) => Collection<TSchema>;
|
|
286
|
-
model:
|
|
295
|
+
model: ModelBindingAccessor;
|
|
287
296
|
};
|
|
288
297
|
instance: MonSQLize;
|
|
289
298
|
}>;
|
|
@@ -315,7 +324,7 @@ export interface MonSQLizeInstance {
|
|
|
315
324
|
*/
|
|
316
325
|
use(name: string): {
|
|
317
326
|
collection: <TSchema = any>(collectionName: string) => Collection<TSchema>;
|
|
318
|
-
model:
|
|
327
|
+
model: ModelBindingAccessor;
|
|
319
328
|
};
|
|
320
329
|
/**
|
|
321
330
|
* Return collection and model accessors for the named connection pool.
|
|
@@ -323,10 +332,10 @@ export interface MonSQLizeInstance {
|
|
|
323
332
|
*/
|
|
324
333
|
pool(poolName: string): {
|
|
325
334
|
collection: <TSchema = any>(name: string) => Collection<TSchema>;
|
|
326
|
-
model:
|
|
335
|
+
model: ModelBindingAccessor;
|
|
327
336
|
use: (dbName: string) => {
|
|
328
337
|
collection: <TSchema = any>(name: string) => Collection<TSchema>;
|
|
329
|
-
model:
|
|
338
|
+
model: ModelBindingAccessor;
|
|
330
339
|
};
|
|
331
340
|
};
|
|
332
341
|
/**
|
|
@@ -341,12 +350,16 @@ export interface MonSQLizeInstance {
|
|
|
341
350
|
* @param name Model name.
|
|
342
351
|
* @param options Optional database or pool scope options.
|
|
343
352
|
*/
|
|
353
|
+
/** @since v3.3.0 */
|
|
354
|
+
scopedModel<TDocument>(descriptor: ModelDescriptor<string, TDocument>, options?: { database?: string; pool?: string; }): ModelInstance<TDocument>;
|
|
344
355
|
scopedModel<TDocument = any>(name: string, options?: { database?: string; pool?: string; }): ModelInstance<TDocument>;
|
|
345
356
|
scopedModel(name: string, options?: { database?: string; pool?: string; }): ModelInstance<any>;
|
|
346
357
|
/**
|
|
347
358
|
* Return the registered model instance for the given model name.
|
|
348
359
|
* @param name Model name used during registration.
|
|
349
360
|
*/
|
|
361
|
+
/** @since v3.3.0 */
|
|
362
|
+
model<TDocument>(descriptor: ModelDescriptor<string, TDocument>): ModelInstance<TDocument>;
|
|
350
363
|
model<TDocument = any>(name: string): ModelInstance<TDocument>;
|
|
351
364
|
model(name: string): ModelInstance<any>;
|
|
352
365
|
/**
|
|
@@ -516,7 +529,7 @@ export default class MonSQLize implements MonSQLizeInstance {
|
|
|
516
529
|
db: (name?: string) => DbAccessor;
|
|
517
530
|
use: (name: string) => {
|
|
518
531
|
collection: <TSchema = any>(collectionName: string) => Collection<TSchema>;
|
|
519
|
-
model:
|
|
532
|
+
model: ModelBindingAccessor;
|
|
520
533
|
};
|
|
521
534
|
instance: MonSQLize;
|
|
522
535
|
}>;
|
|
@@ -529,20 +542,24 @@ export default class MonSQLize implements MonSQLizeInstance {
|
|
|
529
542
|
db(name?: string): DbAccessor;
|
|
530
543
|
use(name: string): {
|
|
531
544
|
collection: <TSchema = any>(collectionName: string) => Collection<TSchema>;
|
|
532
|
-
model:
|
|
545
|
+
model: ModelBindingAccessor;
|
|
533
546
|
};
|
|
534
547
|
pool(poolName: string): {
|
|
535
548
|
collection: <TSchema = any>(name: string) => Collection<TSchema>;
|
|
536
|
-
model:
|
|
549
|
+
model: ModelBindingAccessor;
|
|
537
550
|
use: (dbName: string) => {
|
|
538
551
|
collection: <TSchema = any>(name: string) => Collection<TSchema>;
|
|
539
|
-
model:
|
|
552
|
+
model: ModelBindingAccessor;
|
|
540
553
|
};
|
|
541
554
|
};
|
|
542
555
|
scopedCollection<TSchema = any>(name: string, options?: { database?: string; pool?: string; }): Collection<TSchema>;
|
|
543
556
|
scopedCollection(name: string, options?: { database?: string; pool?: string; }): Collection<any>;
|
|
557
|
+
/** @since v3.3.0 */
|
|
558
|
+
scopedModel<TDocument>(descriptor: ModelDescriptor<string, TDocument>, options?: { database?: string; pool?: string; }): ModelInstance<TDocument>;
|
|
544
559
|
scopedModel<TDocument = any>(name: string, options?: { database?: string; pool?: string; }): ModelInstance<TDocument>;
|
|
545
560
|
scopedModel(name: string, options?: { database?: string; pool?: string; }): ModelInstance<any>;
|
|
561
|
+
/** @since v3.3.0 */
|
|
562
|
+
model<TDocument>(descriptor: ModelDescriptor<string, TDocument>): ModelInstance<TDocument>;
|
|
546
563
|
model<TDocument = any>(name: string): ModelInstance<TDocument>;
|
|
547
564
|
model(name: string): ModelInstance<any>;
|
|
548
565
|
ensureModelIndexes(options?: ModelEnsureAllIndexesOptions): Promise<ModelIndexEnsureSummary>;
|
|
@@ -601,6 +618,8 @@ export default class MonSQLize implements MonSQLizeInstance {
|
|
|
601
618
|
static LockTimeoutError: typeof import('./lock.mjs').LockTimeoutError;
|
|
602
619
|
static DistributedCacheInvalidator: typeof DistributedCacheInvalidator;
|
|
603
620
|
static ConnectionPoolManager: typeof import('./pool.mjs').ConnectionPoolManager;
|
|
621
|
+
/** @since v3.3.0 */
|
|
622
|
+
static defineModel: typeof import('./model.mjs').defineModel;
|
|
604
623
|
static Model: typeof import('./runtime.mjs').Model;
|
|
605
624
|
static ModelInstance: typeof import('./runtime.mjs').ModelInstance;
|
|
606
625
|
static expr: typeof expr;
|
|
@@ -35,7 +35,7 @@ export interface SSHConfig {
|
|
|
35
35
|
import type { Collection, CursorValueNormalizer, CursorValueType, DbAccessor, HealthView } from './collection';
|
|
36
36
|
import type { DataTaskJobError } from './data-tasks';
|
|
37
37
|
import type { Lock, LockOptions, LockStats } from './lock';
|
|
38
|
-
import type { ModelAutoIndexOptions, ModelEnsureAllIndexesOptions, ModelIndexEnsureSummary, ModelInstance } from './model';
|
|
38
|
+
import type { ModelAutoIndexOptions, ModelDescriptor, ModelEnsureAllIndexesOptions, ModelIndexEnsureSummary, ModelInstance } from './model';
|
|
39
39
|
import type { MongoConnectConfig } from './mongodb';
|
|
40
40
|
import type { ConnectionPoolManagerOptions, PoolConfig, PoolHealthStatus, PoolStats, PoolStrategy } from './pool';
|
|
41
41
|
import type {
|
|
@@ -70,6 +70,15 @@ import type { SlowQueryLogConfigInput, SlowQueryLogEntry, SlowQueryLogFilter, Sl
|
|
|
70
70
|
import type { ChangeStreamSyncManager, SyncConfig, SyncStats } from './sync';
|
|
71
71
|
import type { Transaction, TransactionOptions, TransactionStats } from './transaction';
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Callable model accessor that preserves a descriptor's inferred document type.
|
|
75
|
+
* @since v3.3.0
|
|
76
|
+
*/
|
|
77
|
+
export interface ModelBindingAccessor {
|
|
78
|
+
<TDocument>(descriptor: ModelDescriptor<string, TDocument>): ModelInstance<TDocument>;
|
|
79
|
+
<TDocument = any>(modelName: string): ModelInstance<TDocument>;
|
|
80
|
+
}
|
|
81
|
+
|
|
73
82
|
/** Write path policy mode. `allow-both` preserves the existing collection and model write behavior. */
|
|
74
83
|
export type WritePathPolicyMode = 'allow-both' | 'model-only';
|
|
75
84
|
|
|
@@ -283,7 +292,7 @@ export interface MonSQLizeInstance {
|
|
|
283
292
|
db: (name?: string) => DbAccessor;
|
|
284
293
|
use: (name: string) => {
|
|
285
294
|
collection: <TSchema = any>(collectionName: string) => Collection<TSchema>;
|
|
286
|
-
model:
|
|
295
|
+
model: ModelBindingAccessor;
|
|
287
296
|
};
|
|
288
297
|
instance: MonSQLize;
|
|
289
298
|
}>;
|
|
@@ -315,7 +324,7 @@ export interface MonSQLizeInstance {
|
|
|
315
324
|
*/
|
|
316
325
|
use(name: string): {
|
|
317
326
|
collection: <TSchema = any>(collectionName: string) => Collection<TSchema>;
|
|
318
|
-
model:
|
|
327
|
+
model: ModelBindingAccessor;
|
|
319
328
|
};
|
|
320
329
|
/**
|
|
321
330
|
* Return collection and model accessors for the named connection pool.
|
|
@@ -323,10 +332,10 @@ export interface MonSQLizeInstance {
|
|
|
323
332
|
*/
|
|
324
333
|
pool(poolName: string): {
|
|
325
334
|
collection: <TSchema = any>(name: string) => Collection<TSchema>;
|
|
326
|
-
model:
|
|
335
|
+
model: ModelBindingAccessor;
|
|
327
336
|
use: (dbName: string) => {
|
|
328
337
|
collection: <TSchema = any>(name: string) => Collection<TSchema>;
|
|
329
|
-
model:
|
|
338
|
+
model: ModelBindingAccessor;
|
|
330
339
|
};
|
|
331
340
|
};
|
|
332
341
|
/**
|
|
@@ -341,12 +350,16 @@ export interface MonSQLizeInstance {
|
|
|
341
350
|
* @param name Model name.
|
|
342
351
|
* @param options Optional database or pool scope options.
|
|
343
352
|
*/
|
|
353
|
+
/** @since v3.3.0 */
|
|
354
|
+
scopedModel<TDocument>(descriptor: ModelDescriptor<string, TDocument>, options?: { database?: string; pool?: string; }): ModelInstance<TDocument>;
|
|
344
355
|
scopedModel<TDocument = any>(name: string, options?: { database?: string; pool?: string; }): ModelInstance<TDocument>;
|
|
345
356
|
scopedModel(name: string, options?: { database?: string; pool?: string; }): ModelInstance<any>;
|
|
346
357
|
/**
|
|
347
358
|
* Return the registered model instance for the given model name.
|
|
348
359
|
* @param name Model name used during registration.
|
|
349
360
|
*/
|
|
361
|
+
/** @since v3.3.0 */
|
|
362
|
+
model<TDocument>(descriptor: ModelDescriptor<string, TDocument>): ModelInstance<TDocument>;
|
|
350
363
|
model<TDocument = any>(name: string): ModelInstance<TDocument>;
|
|
351
364
|
model(name: string): ModelInstance<any>;
|
|
352
365
|
/**
|
|
@@ -516,7 +529,7 @@ export default class MonSQLize implements MonSQLizeInstance {
|
|
|
516
529
|
db: (name?: string) => DbAccessor;
|
|
517
530
|
use: (name: string) => {
|
|
518
531
|
collection: <TSchema = any>(collectionName: string) => Collection<TSchema>;
|
|
519
|
-
model:
|
|
532
|
+
model: ModelBindingAccessor;
|
|
520
533
|
};
|
|
521
534
|
instance: MonSQLize;
|
|
522
535
|
}>;
|
|
@@ -529,20 +542,24 @@ export default class MonSQLize implements MonSQLizeInstance {
|
|
|
529
542
|
db(name?: string): DbAccessor;
|
|
530
543
|
use(name: string): {
|
|
531
544
|
collection: <TSchema = any>(collectionName: string) => Collection<TSchema>;
|
|
532
|
-
model:
|
|
545
|
+
model: ModelBindingAccessor;
|
|
533
546
|
};
|
|
534
547
|
pool(poolName: string): {
|
|
535
548
|
collection: <TSchema = any>(name: string) => Collection<TSchema>;
|
|
536
|
-
model:
|
|
549
|
+
model: ModelBindingAccessor;
|
|
537
550
|
use: (dbName: string) => {
|
|
538
551
|
collection: <TSchema = any>(name: string) => Collection<TSchema>;
|
|
539
|
-
model:
|
|
552
|
+
model: ModelBindingAccessor;
|
|
540
553
|
};
|
|
541
554
|
};
|
|
542
555
|
scopedCollection<TSchema = any>(name: string, options?: { database?: string; pool?: string; }): Collection<TSchema>;
|
|
543
556
|
scopedCollection(name: string, options?: { database?: string; pool?: string; }): Collection<any>;
|
|
557
|
+
/** @since v3.3.0 */
|
|
558
|
+
scopedModel<TDocument>(descriptor: ModelDescriptor<string, TDocument>, options?: { database?: string; pool?: string; }): ModelInstance<TDocument>;
|
|
544
559
|
scopedModel<TDocument = any>(name: string, options?: { database?: string; pool?: string; }): ModelInstance<TDocument>;
|
|
545
560
|
scopedModel(name: string, options?: { database?: string; pool?: string; }): ModelInstance<any>;
|
|
561
|
+
/** @since v3.3.0 */
|
|
562
|
+
model<TDocument>(descriptor: ModelDescriptor<string, TDocument>): ModelInstance<TDocument>;
|
|
546
563
|
model<TDocument = any>(name: string): ModelInstance<TDocument>;
|
|
547
564
|
model(name: string): ModelInstance<any>;
|
|
548
565
|
ensureModelIndexes(options?: ModelEnsureAllIndexesOptions): Promise<ModelIndexEnsureSummary>;
|
|
@@ -601,6 +618,8 @@ export default class MonSQLize implements MonSQLizeInstance {
|
|
|
601
618
|
static LockTimeoutError: typeof import('./lock').LockTimeoutError;
|
|
602
619
|
static DistributedCacheInvalidator: typeof DistributedCacheInvalidator;
|
|
603
620
|
static ConnectionPoolManager: typeof import('./pool').ConnectionPoolManager;
|
|
621
|
+
/** @since v3.3.0 */
|
|
622
|
+
static defineModel: typeof import('./model').defineModel;
|
|
604
623
|
static Model: typeof import('./runtime').Model;
|
|
605
624
|
static ModelInstance: typeof import('./runtime').ModelInstance;
|
|
606
625
|
static expr: typeof expr;
|
package/dist/types/runtime.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BookmarkClearResult, BookmarkListResult, BookmarkPrewarmResult, DeleteBatchResult, DeleteResult, IncrementOneResult, IndexCreateResult, InsertBatchResult, InsertManyResult, UpdateBatchResult, UpdateResult } from './collection.mjs';
|
|
2
2
|
import type { LoggerLike, ExpressionFunction, ExpressionObject } from './base.mjs';
|
|
3
|
-
import type { ModelDefinition, ModelEnsureIndexesOptions, ModelIndexEnsureResult, ModelInstance as ModelInstanceContract, RegisteredModel, RelationConfig } from './model.mjs';
|
|
3
|
+
import type { ModelDefinition, ModelDescriptor, ModelEnsureIndexesOptions, ModelIndexEnsureResult, ModelInstance as ModelInstanceContract, RegisteredModel, RelationConfig } from './model.mjs';
|
|
4
4
|
import type { LockOptions, LockStats } from './lock.mjs';
|
|
5
5
|
import type { ConnectionPoolManagerOptions, FallbackStrategy, PoolConfig, PoolHealthStatus, PoolRole, PoolStats, PoolStrategy } from './pool.mjs';
|
|
6
6
|
import type { SagaDefinition, SagaOrchestratorOptions, SagaResult, SagaStats, SagaStep } from './saga.mjs';
|
|
@@ -289,6 +289,8 @@ export declare class FunctionCache {
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
export declare class Model {
|
|
292
|
+
/** @since v3.3.0 */
|
|
293
|
+
static define<TName extends string, TDocument>(descriptor: ModelDescriptor<TName, TDocument>): void;
|
|
292
294
|
static define<TDocument = any>(name: string, definition: ModelDefinition<TDocument>): void;
|
|
293
295
|
static get<TDocument = any>(name: string): RegisteredModel<TDocument> | undefined;
|
|
294
296
|
static has(name: string): boolean;
|
|
@@ -334,6 +336,7 @@ export declare class ModelInstance<TDocument = any> implements ModelInstanceCont
|
|
|
334
336
|
meta?: import('./collection.mjs').MetaInfo;
|
|
335
337
|
}>;
|
|
336
338
|
findAndCount(query?: unknown, options?: unknown): import('./model.mjs').PopulateProxy<{ data: Array<import('./model.mjs').ModelDocument<TDocument>>; total: number; }>;
|
|
339
|
+
vectorSearch(options: import('./model.mjs').ModelVectorSearchOptions): Promise<Array<import('./collection.mjs').VectorSearchHit<import('./model.mjs').ModelDocument<TDocument>>>>;
|
|
337
340
|
count(query?: unknown, options?: unknown): Promise<number>;
|
|
338
341
|
insertOne(document?: unknown, options?: unknown): Promise<{ acknowledged: boolean; insertedId: any; }>;
|
|
339
342
|
insertMany(documents?: unknown[], options?: unknown): Promise<InsertManyResult>;
|
|
@@ -345,6 +348,9 @@ export declare class ModelInstance<TDocument = any> implements ModelInstanceCont
|
|
|
345
348
|
upsertOne(filter?: unknown, update?: unknown, options?: unknown): Promise<UpdateResult>;
|
|
346
349
|
deleteOne(filter?: unknown, options?: unknown): Promise<DeleteResult>;
|
|
347
350
|
deleteMany(filter?: unknown, options?: unknown): Promise<DeleteResult>;
|
|
351
|
+
checkRelationUsage(filter?: unknown, options?: import('./model.mjs').RelationUsageOptions): Promise<import('./model.mjs').RelationUsageReport>;
|
|
352
|
+
deleteOneWithRelations(filter: unknown, options?: import('./model.mjs').RelationProtectedDeleteOptions): Promise<import('./model.mjs').RelationProtectedDeleteResult>;
|
|
353
|
+
forceDeleteWithRelations(filter: unknown, options?: import('./model.mjs').RelationProtectedDeleteOptions): Promise<import('./model.mjs').RelationProtectedDeleteResult>;
|
|
348
354
|
createIndex(keys: unknown, options?: unknown): Promise<IndexCreateResult>;
|
|
349
355
|
createIndexes(specs: Array<{ key: unknown; } & Record<string, unknown>>): Promise<string[]>;
|
|
350
356
|
listIndexes(): Promise<Record<string, unknown>[]>;
|
package/dist/types/runtime.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BookmarkClearResult, BookmarkListResult, BookmarkPrewarmResult, DeleteBatchResult, DeleteResult, IncrementOneResult, IndexCreateResult, InsertBatchResult, InsertManyResult, UpdateBatchResult, UpdateResult } from './collection';
|
|
2
2
|
import type { LoggerLike, ExpressionFunction, ExpressionObject } from './base';
|
|
3
|
-
import type { ModelDefinition, ModelEnsureIndexesOptions, ModelIndexEnsureResult, ModelInstance as ModelInstanceContract, RegisteredModel, RelationConfig } from './model';
|
|
3
|
+
import type { ModelDefinition, ModelDescriptor, ModelEnsureIndexesOptions, ModelIndexEnsureResult, ModelInstance as ModelInstanceContract, RegisteredModel, RelationConfig } from './model';
|
|
4
4
|
import type { LockOptions, LockStats } from './lock';
|
|
5
5
|
import type { ConnectionPoolManagerOptions, FallbackStrategy, PoolConfig, PoolHealthStatus, PoolRole, PoolStats, PoolStrategy } from './pool';
|
|
6
6
|
import type { SagaDefinition, SagaOrchestratorOptions, SagaResult, SagaStats, SagaStep } from './saga';
|
|
@@ -289,6 +289,8 @@ export declare class FunctionCache {
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
export declare class Model {
|
|
292
|
+
/** @since v3.3.0 */
|
|
293
|
+
static define<TName extends string, TDocument>(descriptor: ModelDescriptor<TName, TDocument>): void;
|
|
292
294
|
static define<TDocument = any>(name: string, definition: ModelDefinition<TDocument>): void;
|
|
293
295
|
static get<TDocument = any>(name: string): RegisteredModel<TDocument> | undefined;
|
|
294
296
|
static has(name: string): boolean;
|
|
@@ -334,6 +336,7 @@ export declare class ModelInstance<TDocument = any> implements ModelInstanceCont
|
|
|
334
336
|
meta?: import('./collection').MetaInfo;
|
|
335
337
|
}>;
|
|
336
338
|
findAndCount(query?: unknown, options?: unknown): import('./model').PopulateProxy<{ data: Array<import('./model').ModelDocument<TDocument>>; total: number; }>;
|
|
339
|
+
vectorSearch(options: import('./model').ModelVectorSearchOptions): Promise<Array<import('./collection').VectorSearchHit<import('./model').ModelDocument<TDocument>>>>;
|
|
337
340
|
count(query?: unknown, options?: unknown): Promise<number>;
|
|
338
341
|
insertOne(document?: unknown, options?: unknown): Promise<{ acknowledged: boolean; insertedId: any; }>;
|
|
339
342
|
insertMany(documents?: unknown[], options?: unknown): Promise<InsertManyResult>;
|
|
@@ -345,6 +348,9 @@ export declare class ModelInstance<TDocument = any> implements ModelInstanceCont
|
|
|
345
348
|
upsertOne(filter?: unknown, update?: unknown, options?: unknown): Promise<UpdateResult>;
|
|
346
349
|
deleteOne(filter?: unknown, options?: unknown): Promise<DeleteResult>;
|
|
347
350
|
deleteMany(filter?: unknown, options?: unknown): Promise<DeleteResult>;
|
|
351
|
+
checkRelationUsage(filter?: unknown, options?: import('./model').RelationUsageOptions): Promise<import('./model').RelationUsageReport>;
|
|
352
|
+
deleteOneWithRelations(filter: unknown, options?: import('./model').RelationProtectedDeleteOptions): Promise<import('./model').RelationProtectedDeleteResult>;
|
|
353
|
+
forceDeleteWithRelations(filter: unknown, options?: import('./model').RelationProtectedDeleteOptions): Promise<import('./model').RelationProtectedDeleteResult>;
|
|
348
354
|
createIndex(keys: unknown, options?: unknown): Promise<IndexCreateResult>;
|
|
349
355
|
createIndexes(specs: Array<{ key: unknown; } & Record<string, unknown>>): Promise<string[]>;
|
|
350
356
|
listIndexes(): Promise<Record<string, unknown>[]>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
{ "name": "cache-hub", "version": "2.2.4", "license": "Apache-2.0", "source": "package-metadata" },
|
|
6
6
|
{ "name": "ioredis", "version": "5.11.1", "license": "MIT", "source": "package-metadata" },
|
|
7
7
|
{ "name": "mongodb", "version": "6.21.0", "license": "Apache-2.0", "source": "package-metadata" },
|
|
8
|
-
{ "name": "schema-dsl", "version": "3.0.
|
|
8
|
+
{ "name": "schema-dsl", "version": "3.0.4", "license": "Apache-2.0", "source": "package-metadata" },
|
|
9
9
|
{ "name": "ssh2", "version": "1.17.0", "license": "MIT", "source": "LICENSE:d06b5d27bbbbe22c36b1fd88406b1208876e2d37d795f5b8eaed951a459a3111" }
|
|
10
10
|
]
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monsqlize",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "TypeScript production data runtime layer for MongoDB today, with cache, transactions, pools, models, sync, and observability",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/cjs/index.cjs",
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
|
+
"changelogs/v3.3.0.md",
|
|
25
|
+
"changelogs/v3.2.0.md",
|
|
24
26
|
"changelogs/v3.1.14.md",
|
|
25
27
|
"changelogs/v3.1.13.md",
|
|
26
28
|
"changelogs/v3.1.12.md",
|
|
@@ -159,7 +161,16 @@
|
|
|
159
161
|
"cache-hub": "2.2.4",
|
|
160
162
|
"ioredis": "5.11.1",
|
|
161
163
|
"mongodb": "6.21.0",
|
|
162
|
-
"schema-dsl": "3.0.
|
|
164
|
+
"schema-dsl": "3.0.4",
|
|
163
165
|
"ssh2": "1.17.0"
|
|
166
|
+
},
|
|
167
|
+
"overrides": {
|
|
168
|
+
"fast-uri": "3.1.5",
|
|
169
|
+
"minimatch@3.1.5": {
|
|
170
|
+
"brace-expansion": "1.1.18"
|
|
171
|
+
},
|
|
172
|
+
"minimatch@10.2.5": {
|
|
173
|
+
"brace-expansion": "5.0.9"
|
|
174
|
+
}
|
|
164
175
|
}
|
|
165
176
|
}
|