Improved a bit of the speed of the application
This commit is contained in:
@@ -173,3 +173,9 @@ export const getGroupsByEntities = async (ids: string[]): Promise<WithEntity<Gro
|
||||
{ $match: { entity: { $in: ids } } },
|
||||
...addEntityToGroupPipeline
|
||||
]).toArray()
|
||||
|
||||
export const countGroups = async () =>
|
||||
await db.collection("groups").countDocuments({})
|
||||
|
||||
export const countGroupsByEntities = async (ids: string[]) =>
|
||||
await db.collection("groups").countDocuments({ entity: { $in: ids } })
|
||||
|
||||
Reference in New Issue
Block a user