Please help me clarify requirements for use of mongo sessions


I’m using mongo sessions to programatically terminate an executing query. Specifically I’m using .startSession of MongoClient and killSessions db command. All that via the java driver interface. The question is however more general.

While trying to find what are the requirements on mongo deployment for use of sessions, I’ve came across following line in the docs:

Server sessions are available for replica sets and sharded clusters only.

in sessions overview.

I currently run mongo locally in docker container. I believe there is no replication and clustering setup in the container.

I interpret the docs sentence in a way, that I should not be able to use sessions if I don’t have that setup.

I can however use sessions in my container just fine. Can you please help me clarify what are the requirements on mongo instance to use sessions? Am I just misinterpreting the terms “replica sets” and “sharded clusters”? Is the sentence incorrect? Thanks.