'MongoClient' object is not callable

I am always getting this error - ‘MongoClient’ object is not callable. My language is python…Please help me

Clearly a syntax error in your code.
Can you paste an example?

2 Likes

from flask import Flask
import pymongo
from pymongo import MongoClient

cluster = MongoClient(
“mongodb+srv://kaustubh:kaustubh@cluster0.c5vao.mongodb.net/myFirstDatabase?retryWrites=true&w=majority”)
db = cluster(“nursery”)
collection = db(“seeds”)

collection.insert_one({"_id": 0, “seed_name”: “peas”, “flower”: “rose”})