fix(collection): improve index creation resilience and add collection integrity checks
This commit is contained in:
@@ -597,6 +597,17 @@ export class SmartDataDbDoc<T extends TImplements, TImplements, TManager extends
|
||||
return await collection.getCount(filterArg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs an integrity check on this collection.
|
||||
* Returns a summary with estimated vs actual counts and any duplicate unique fields.
|
||||
*/
|
||||
public static async checkCollectionIntegrity<T>(
|
||||
this: plugins.tsclass.typeFest.Class<T>,
|
||||
) {
|
||||
const collection: SmartdataCollection<T> = (this as any).collection;
|
||||
return await collection.checkCollectionIntegrity();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a MongoDB filter from a Lucene query string
|
||||
* @param luceneQuery Lucene query string
|
||||
|
||||
Reference in New Issue
Block a user