[SERVER-29628] Add aggregation stages to list all active logical sessions on the cluster Created: 14/Jun/17  Updated: 30/Oct/23  Resolved: 23/Aug/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.5.13

Type: New Feature Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Sara Golemon
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-28335 Implement the refreshSessions command Closed
Documented
is documented by DOCS-10735 Docs for SERVER-29628: Add aggregatio... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2017-07-31, Platforms 2017-08-21, Platforms 2017-09-11
Participants:

 Description   

Two aggregation stages:
$listLocalSessions - Ennumerate sessions in the node's LogicalSessionsCache
$listSessions - Ennumerate sessions recorded in the admin.system.sessions collection

Each stage accepts the following spec:
{
allUsers: true|false,
users: [

{user:"name", db: "dbname"}

, ... ],
}

allUsers == true will ennumerate all users from the specified source and requires ActionType::listSessions. Specifying a list of users with allUsers==true is an error.

allUsers == false with no users explicitly specified will default to the currently authenticated user (or non-user if auth is not enabled). If any user is specified in the users array who is NOT the currently logged in user, then ActionType::listSessions is required.



 Comments   
Comment by Ramon Fernandez Marina [ 24/Aug/17 ]

Author:

{'username': u'sgolemon', 'name': u'Sara Golemon', 'email': u'sara.golemon@mongodb.com'}

Message:SERVER-29628 $listLocalSessions aggregation stage
Branch:master
https://github.com/mongodb/mongo/commit/a09f19822fb2a1e5b662bd8d542dd8e2f2607fc6

Comment by Ramon Fernandez Marina [ 24/Aug/17 ]

Author:

{'username': u'sgolemon', 'name': u'Sara Golemon', 'email': u'sara.golemon@mongodb.com'}

Message:SERVER-29628 $listSessions aggregation stage
Branch:master
https://github.com/mongodb/mongo/commit/0b09cf4477986074237c3f53afa6830a89fd4592

Comment by Jeffrey Yemin [ 23/Aug/17 ]

Please consider not exposing the admin.system.sessions collection in the public API. If $listSessions has to run against only that collection, make it implicit rather than explicit, e.g.

db.aggregate([{$listSessions : {}}])

This both hides an implementation detail and makes it easier to use.

Generated at Thu Feb 08 04:21:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.