@tmlmobilidade/databases 20260324.1728.13 → 20260325.918.20

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,4 @@
1
- import type { AnyBulkWriteOperation, BulkWriteOptions, ChangeStreamOptions, Collection, Document, Filter, FindOptions, InsertOneOptions, MongoClient, UpdateOptions, WithId } from 'mongodb';
1
+ import type { AnyBulkWriteOperation, BulkWriteOptions, Collection, Document, Filter, FindOptions, InsertOneOptions, MongoClient, UpdateOptions, WithId } from 'mongodb';
2
2
  import { type SimplifiedMongoIndex } from '../types/mongo/index-description.js';
3
3
  import { z } from 'zod';
4
4
  export declare abstract class MongoInterfaceTemplate<T extends Document, TCreate, TUpdate> {
@@ -36,14 +36,6 @@ export declare abstract class MongoInterfaceTemplate<T extends Document, TCreate
36
36
  * @returns A promise that resolves to an array of matching documents.
37
37
  */
38
38
  findMany(filter?: Filter<T>, options?: FindOptions): Promise<WithId<T>[]>;
39
- /**
40
- * Finds multiple documents matching the filter criteria,
41
- * with optional pagination and sorting, and returns a cursor for streaming results.
42
- * @param filter (Optional) filter criteria to match documents.
43
- * @param options (Optional) find options.
44
- * @returns A promise that resolves to a cursor for streaming matching documents.
45
- */
46
- stream(filter?: Filter<T>, options?: FindOptions): import("node:stream").Readable & AsyncIterable<WithId<T>>;
47
39
  /**
48
40
  * Finds a single document matching the filter criteria.
49
41
  * @param filter The filter criteria to match the document.
@@ -84,13 +76,6 @@ export declare abstract class MongoInterfaceTemplate<T extends Document, TCreate
84
76
  * It is the responsibility of the caller to ensure that the operations are valid and conform to the expected schemas.
85
77
  */
86
78
  bulkWrite(operations: AnyBulkWriteOperation<T>[], options?: BulkWriteOptions): Promise<import("mongodb").BulkWriteResult>;
87
- /**
88
- * Watches for changes in the MongoDB collection and returns a change stream cursor.
89
- * @param pipeline (Optional) An array of aggregation pipeline stages to filter the change events.
90
- * @param options (Optional) Change stream options to configure the behavior of the change stream.
91
- * @returns A change stream cursor that can be used to iterate over the change events.
92
- */
93
- watch(pipeline?: Document[], options?: ChangeStreamOptions): import("mongodb").ChangeStream<T, import("mongodb").ChangeStreamDocument<T>>;
94
79
  /**
95
80
  * Inserts multiple documents into the collection after validating them against the create schema.
96
81
  * @param data An array of documents to insert, conforming to the TCreate type.
@@ -38,16 +38,6 @@ export class MongoInterfaceTemplate {
38
38
  async findMany(filter, options) {
39
39
  return await this.collection.find(filter, options).toArray();
40
40
  }
41
- /**
42
- * Finds multiple documents matching the filter criteria,
43
- * with optional pagination and sorting, and returns a cursor for streaming results.
44
- * @param filter (Optional) filter criteria to match documents.
45
- * @param options (Optional) find options.
46
- * @returns A promise that resolves to a cursor for streaming matching documents.
47
- */
48
- stream(filter, options) {
49
- return this.collection.find(filter, options).stream();
50
- }
51
41
  /**
52
42
  * Finds a single document matching the filter criteria.
53
43
  * @param filter The filter criteria to match the document.
@@ -104,15 +94,6 @@ export class MongoInterfaceTemplate {
104
94
  async bulkWrite(operations, options) {
105
95
  return await this.collection.bulkWrite(operations, options);
106
96
  }
107
- /**
108
- * Watches for changes in the MongoDB collection and returns a change stream cursor.
109
- * @param pipeline (Optional) An array of aggregation pipeline stages to filter the change events.
110
- * @param options (Optional) Change stream options to configure the behavior of the change stream.
111
- * @returns A change stream cursor that can be used to iterate over the change events.
112
- */
113
- watch(pipeline, options) {
114
- return this.collection.watch(pipeline, options);
115
- }
116
97
  /**
117
98
  * Inserts multiple documents into the collection after validating them against the create schema.
118
99
  * @param data An array of documents to insert, conforming to the TCreate type.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/databases",
3
- "version": "20260324.1728.13",
3
+ "version": "20260325.918.20",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"