Use countDocuments() instead of the deprecated count() in MongoDB
MODIFY
src/storage/mongodb/TagStorage.ts
src/storage/mongodb/TagStorage.ts
@@ -124,7 +124,7 @@ export default class TagStorage {
// Check Tenant
await DatabaseUtils.checkTenant(tenantID);
// Count documents
- const nbrOfDocuments = await global.database.getCollection<any>(tenantID, 'importedtags').count();
+ const nbrOfDocuments = await global.database.getCollection<any>(tenantID, 'importedtags').countDocuments();
// Debug
await Logging.traceEnd(tenantID, MODULE_NAME, 'getImportedTagsCount', uniqueTimerID);
return nbrOfDocuments;

MODIFY
src/storage/mongodb/UserStorage.ts
src/storage/mongodb/UserStorage.ts
@@ -734,7 +734,7 @@ export default class UserStorage {
// Check Tenant
await DatabaseUtils.checkTenant(tenantID);
// Count documents
- const nbrOfDocuments = await global.database.getCollection<any>(tenantID, 'importedusers').count();
+ const nbrOfDocuments = await global.database.getCollection<any>(tenantID, 'importedusers').countDocuments();
// Debug
await Logging.traceEnd(tenantID, MODULE_NAME, 'getImportedUsersCount', uniqueTimerID);
return nbrOfDocuments;

Use countDocuments() instead of the deprecated count() in MongoDB