@trust0/ridb-mongodb 0.0.2 → 0.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 CHANGED
@@ -1,3 +1,35 @@
1
+ ## 0.0.4 (2025-09-06)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - editor configuration auto save [skip ci] ([7cb2249](https://github.com/trust0-project/RIDB/commit/7cb2249))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated @trust0/ridb-build to 0.0.21
10
+ - Updated @trust0/ridb-core to 1.7.32
11
+ - Updated @trust0/ridb to 1.5.37
12
+
13
+ ### ❤️ Thank You
14
+
15
+ - Javier Ribó
16
+
17
+ ## 0.0.3 (2025-07-22)
18
+
19
+ ### 🩹 Fixes
20
+
21
+ - current structure doesn't manage examples very well will figure out later ([bcb8934](https://github.com/trust0-project/RIDB/commit/bcb8934))
22
+ - specify packages ([b49617b](https://github.com/trust0-project/RIDB/commit/b49617b))
23
+ - mongodb improvement ([3f89e54](https://github.com/trust0-project/RIDB/commit/3f89e54))
24
+
25
+ ### 🧱 Updated Dependencies
26
+
27
+ - Updated @trust0/ridb to 1.5.36
28
+
29
+ ### ❤️ Thank You
30
+
31
+ - Javier Ribó
32
+
1
33
  ## 0.0.2 (2025-07-22)
2
34
 
3
35
  ### 🩹 Fixes
package/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseStorageOptions, SchemaTypeRecord, BaseStorage, Doc, Operation, QueryType, QueryOptions } from '@trust0/ridb-core';
1
+ import { BaseStorageOptions, SchemaTypeRecord, BaseStorage } from '@trust0/ridb-core';
2
2
 
3
3
  /**
4
4
  * @packageDocumentation
@@ -22,6 +22,7 @@ import { BaseStorageOptions, SchemaTypeRecord, BaseStorage, Doc, Operation, Quer
22
22
  *
23
23
  * # SDK Rerefence
24
24
  */
25
+ /** biome-ignore-all lint/suspicious/noExplicitAny: Not needed here */
25
26
 
26
27
  interface MongoDBConfig {
27
28
  /** MongoDB connection URL */
@@ -32,49 +33,6 @@ interface MongoDBConfig {
32
33
  mongoOptions?: Record<string, any>;
33
34
  }
34
35
  type MongoDBStorageOptions = BaseStorageOptions & MongoDBConfig;
35
- /**
36
- * MongoDB storage implementation class
37
- * @public
38
- */
39
- declare class MongoDBStorage<T extends SchemaTypeRecord> extends BaseStorage<T> {
40
- private client?;
41
- private db?;
42
- private mongoConfig;
43
- constructor(name: string, schemas: T, options?: MongoDBStorageOptions);
44
- /**
45
- * Utility method to recursively convert ObjectId values to strings throughout an object
46
- * This ensures that MongoDB's ObjectId instances are never returned to the application layer,
47
- * maintaining consistency with RIDB's string-based approach and preventing serialization issues.
48
- * Also removes MongoDB's automatic _id field entirely from results.
49
- * @private
50
- */
51
- private convertObjectIdsToStrings;
52
- /**
53
- * Create a new MongoDB storage instance
54
- * @param name - Database name
55
- * @param schemas - Collection schemas
56
- * @param options - Storage options including MongoDB connection details
57
- * @returns A new Instance of MongoDB storage
58
- * @public
59
- */
60
- static create<SchemasCreate extends SchemaTypeRecord>(name: string, schemas: SchemasCreate, options?: MongoDBStorageOptions): Promise<MongoDBStorage<SchemasCreate>>;
61
- /** Start the database connection */
62
- start(): Promise<void>;
63
- /** Close the database connection */
64
- close(): Promise<void>;
65
- /** Get MongoDB collection for a given collection name */
66
- private getCollection;
67
- /** Find a document by its ID */
68
- findDocumentById(collectionName: keyof T, id: string): Promise<Doc<T[keyof T]> | null>;
69
- /** Write an operation (insert, update, delete) */
70
- write(op: Operation<T[keyof T]>): Promise<Doc<T[keyof T]>>;
71
- /** Convert RIDB query to MongoDB filter */
72
- private convertQueryToMongoFilter;
73
- /** Count documents matching a query (supports offset & limit) */
74
- count(collectionName: keyof T, query: QueryType<T[keyof T]>, options?: QueryOptions): Promise<number>;
75
- /** Find documents matching a query with pagination */
76
- find(collectionName: keyof T, query: QueryType<T[keyof T]>, options?: QueryOptions): Promise<Doc<T[keyof T]>[]>;
77
- }
78
36
  /**
79
37
  * Create a MongoDB storage instance
80
38
  * @public
@@ -82,4 +40,4 @@ declare class MongoDBStorage<T extends SchemaTypeRecord> extends BaseStorage<T>
82
40
  */
83
41
  declare function createMongoDB<T extends SchemaTypeRecord>(): Promise<typeof BaseStorage<T>>;
84
42
 
85
- export { type MongoDBConfig, MongoDBStorage, type MongoDBStorageOptions, createMongoDB };
43
+ export { type MongoDBConfig, type MongoDBStorageOptions, createMongoDB };