- Aggiungere numero di persone registrate, e num di competenze, e numGruppi
This commit is contained in:
@@ -2560,12 +2560,17 @@ UserSchema.statics.calculateStat = async function(idapp, username) {
|
||||
const {MySkill} = require('../models/myskill');
|
||||
const {MyGroup} = require('../models/mygroup');
|
||||
|
||||
const numUsersReg = await User.count({
|
||||
const numUsersReg = await User.countDocuments(
|
||||
{
|
||||
idapp,
|
||||
$or: [{deleted: {$exists: false}}, {deleted: {$exists: true, $eq: false}}],
|
||||
$or: [
|
||||
{deleted: {$exists: false}},
|
||||
{deleted: {$exists: true, $eq: false}}],
|
||||
});
|
||||
const numMySkills = await MySkill.count({idapp});
|
||||
const numGroups = await MyGroup.count({idapp});
|
||||
|
||||
const numMySkills = await MySkill.countDocuments({idapp});
|
||||
|
||||
const numGroups = await MyGroup.countDocuments({idapp});
|
||||
|
||||
return {numMySkills, numUsersReg, numGroups};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user