from pymongo import MongoClient
## Run `db.serverStatus().connections`via mongo shell to check the current number of connections
client = MongoClient()
## Run the `db.serverStatus().connections` command again, it should increment by 1
client.test_database.posts.insert_one({"author": "Mike"}).inserted_id
## Now if you run `db.serverStatus().connections` command again, it again increments by 1
##But if you repeat insert (or any other command besides createing a new connection) it wont create another connection
Python - 3.5.1
Mac OSX - 10.10.5
Mongo Version - 3.2.4
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/96895ac1-a6a5-4cbb-8f29-7d567e005486%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
{ name : "Jason Carey",
title : "Software Engineer",
location : "New York, NY",
twitter : ["@MongoDB", "@MongoDBInc"],
facebook : ["MongoDB", "MongoDB, Inc."] }