Decrease user sessions amount

Description

We use KeyCloack as OAuth2 for authentication in Rocker Chat with SSO using Kerberos on domain joined computers. So, users don’t even need to enter their user name and password at office.
And I did everyday logoff from office computer, and I think that lead to increase of my user sessions.
Can I clean that user sessions somehow?
In MongoDB for my user I see

rs0:PRIMARY> db.rocketchat_sessions.find({"userId":"iodE4TwMg4i729GoH"}).count()
1398

I think it’s too much.
How to clean it?
Did try to Logoff from all other devices - no luck.
Right after that command

rs0:PRIMARY> db.rocketchat_sessions.find({"userId":"iodE4TwMg4i729GoH"}).count()
1400

Today early morning

rs0:PRIMARY> db.rocketchat_sessions.find({"userId":"iodE4TwMg4i729GoH"}).count()
1420

After today aggregate_session task was done

rs0:PRIMARY> db.rocketchat_sessions.find({"userId":"iodE4TwMg4i729GoH"}).count()
1386

Here is examples of other users sessions:

rs0:PRIMARY> db.rocketchat_sessions.find({"userId":"pfb6DduXne7szJnN9"}).count()
331
rs0:PRIMARY> db.rocketchat_sessions.find({"userId":"eHdJn2agKebvNnnYb"}).count()
413
rs0:PRIMARY> db.rocketchat_sessions.find({"userId":"v2te7tXk4DSg6MkPZ"}).count()
173
rs0:PRIMARY> db.rocketchat_sessions.find({"userId":"ddRErmoDRMohuQ2d2"}).count()
463
rs0:PRIMARY> db.rocketchat_sessions.find({"userId":"B4SsyfkyfJ289BLNx"}).count()
577

How to force aggregate_session to clean most of sessions?

Server Setup Information

  • Version of Rocket.Chat Server: 3.1.1
  • Operating System: CentOS7
  • Deployment Method: docker
  • Number of Running Instances: 25
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: v12.16.1
  • MongoDB Version: 4.0.17
  • Proxy: Nginx