I'm storing data on a MongoDB Atlas cluster, but I noticed that when I execute a very simple query, my script will take more than 5 seconds to execute. Since I need the query to be as fast as possible, can someone help me find if I'm doing something wrong? I'm not having issues with my internet's speed, so that is not the problem.
The average record looks like this:
{"_id":{"$oid":"id"},"datetimeraw":"202007061535","rate":{"$numberInt":"950"},"amount":{"$numberDouble":"246.900944"},"datetime":{"$date":{"$numberLong":"1594049700000"}}}
And right now I have a total of 1000 records. The problem is that I know I'll probably reach 20/30k records. But if I'm having issues right now, I'm afraid that with that number of records it will be unbearable. Can the problem be caused by MongoDB Atlas itself?
Here is my code:
import numpy as np
import pandas as pd
from pymongo import MongoClient
client = MongoClient('mongodb+srv://user:pass@test-2liju.mongodb.net/test?retryWrites=true')
db = client.mydata
pData = pd.DataFrame(list(db.mydata.find()))
print(pData)