tauri-plugin-mongoose 0.3.2 → 0.3.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/dist/index.d.mts CHANGED
@@ -63,6 +63,9 @@ declare class Model {
63
63
  sort?: object;
64
64
  }): Promise<InferSchemaType<typeof this.schema> | null>;
65
65
  create(doc: InferSchemaType<typeof this.schema>): Promise<InferSchemaType<typeof this.schema>>;
66
+ updateOne(filter: object, update: object, options?: {
67
+ upsert?: boolean;
68
+ }): Promise<any>;
66
69
  }
67
70
 
68
71
  interface ConnectOptions {
package/dist/index.d.ts CHANGED
@@ -63,6 +63,9 @@ declare class Model {
63
63
  sort?: object;
64
64
  }): Promise<InferSchemaType<typeof this.schema> | null>;
65
65
  create(doc: InferSchemaType<typeof this.schema>): Promise<InferSchemaType<typeof this.schema>>;
66
+ updateOne(filter: object, update: object, options?: {
67
+ upsert?: boolean;
68
+ }): Promise<any>;
66
69
  }
67
70
 
68
71
  interface ConnectOptions {
package/dist/index.js CHANGED
@@ -167,6 +167,14 @@ var Model = class {
167
167
  document: validatedDoc
168
168
  });
169
169
  }
170
+ async updateOne(filter, update, options = {}) {
171
+ return await (0, import_core.invoke)("plugin:mongoose|update_one", {
172
+ collection: this.name,
173
+ filter,
174
+ update,
175
+ options
176
+ });
177
+ }
170
178
  };
171
179
 
172
180
  // index.ts
package/dist/index.mjs CHANGED
@@ -139,6 +139,14 @@ var Model = class {
139
139
  document: validatedDoc
140
140
  });
141
141
  }
142
+ async updateOne(filter, update, options = {}) {
143
+ return await invoke("plugin:mongoose|update_one", {
144
+ collection: this.name,
145
+ filter,
146
+ update,
147
+ options
148
+ });
149
+ }
142
150
  };
143
151
 
144
152
  // index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tauri-plugin-mongoose",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Tauri plugin for MongoDB/Mongoose-like database operations",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",