fix(collection): ensure unique indexes are marked before upsert operations

This commit is contained in:
2026-04-05 03:49:56 +00:00
parent 78207ffad6
commit f3a4a3bbba
3 changed files with 8 additions and 1 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartdata',
version: '7.1.4',
version: '7.1.5',
description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.'
}

View File

@@ -460,6 +460,7 @@ export class SmartdataCollection<T> {
): Promise<any> {
await this.init();
await this.checkDoc(dbDocArg);
await this.markUniqueIndexes(dbDocArg.uniqueIndexes);
const identifiableObject = await dbDocArg.createIdentifiableObject();
const saveableObject = await dbDocArg.createSavableObject() as any;
const updateableObject: any = {};