Chapter 1, MongoClient, client.stats


It’s maybe silly question but in Jupiter Notebook in Chapter 1 where it’s explaining MongoClient there is a command:


that gives following info:

Database(MongoClient(host=['', '', ''], document_class=dict, tz_aware=False, connect=True, authsource='admin', replicaset='atlas-js08eu-shard-0', ssl=True), 'stats')

Where this command comes from? There is nothing in API documentation on MongoClient. If I do


the stats is not shown as one of the available class methods.

What gives?

Hi @mattjavaly,

Can you please take a look at this post ?

~ Shubham

Hi @Dejan_Batic,

I am not sure if I understand your question right. But in jupyter notebook, we are using pymongo which returns client object after successfull connection with Mongo using MongoClient. Here is the documentation I found helpful for the notebook:

client.stats just outputs the connection response consisting of nodes you are connecting to and basic configuration stats.


Hi kanikasingla

Thank you for you time.

I’m trying to understand where exactly that


command comes from. It’s not a method from client object and I don’t see it in MongoClient documentation.