Replace endpoint events/count by documentCount
We presume that contDocument we will retrieve the data more efficiently that the way is done today with find({}).length
Mongoose supports countDocument https://mongoosejs.com/docs/api.html#model_Model.countDocuments
Current performance is:
Data taken from: https://gitlab.esrf.fr/demariaa/performancetests/-/tree/master/logbook/QueryAndCount/tests/localhost_icatplus_2
Edited by Alejandro De Maria Antolinos