Skip to content
On this page

stratadb / UpdateResult

Type Alias: UpdateResult

ts
type UpdateResult = object;

Defined in: src/collection-types.ts:69

Result of an update operation.

Remarks

Provides statistics about documents matched and modified by the update. Since SQLite is ACID and local, if this function returns without throwing, the operation succeeded.

Example

typescript
const result = await users.updateMany(
  { status: 'inactive' },
  { $set: { status: 'deleted' } }
);
console.log(`Matched: ${result.matchedCount}, Modified: ${result.modifiedCount}`);

Properties

matchedCount

ts
readonly matchedCount: number;

Defined in: src/collection-types.ts:71

Number of documents that matched the filter


modifiedCount

ts
readonly modifiedCount: number;

Defined in: src/collection-types.ts:74

Number of documents that were actually modified

Released under the MIT License.