0

I am using pymongo 3.11.3 in my notebook project. The value for int32 is returning constant 100 by pymongo. Query is returning fine in MongoDB IDE. Here is the code

client = MongoClient("localhost", 27017)
db = client['mongodb_vs_mysql']
mongo_result = db.collection['covid19'].find().sort("Cases_person", -1).limit(30);
for i in list(mongo_result):
    print(i)

enter image description here

enter image description here

The database has different values but when querying with pymongo, it is showing 100 for that column.

Need help

0

2 Answers 2

1

I'd be fairly certain that you're looking at different databases; for a start, you have different (albeit similar) ids, and different field names (Daily_Cumulative vs Daily / cumulative)

Sign up to request clarification or add additional context in comments.

Comments

0

I was doing mistake in this code

db.collection['covid19'] should be db['covid19']

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.