DocumentDB with Pymongo very slow to query

Viewed 15

I'm using SageMaker notebooks together with a DocumentDB database. I'm running my notebook inside the VPC where the DocumentDB is, yet, retrieving data is taking a huge amount of time. I have roughly 60k documents in a collection. Consider the code below:

numbers = []
for x in collection.find({},{'number':1}):
   numbers.append(x)

The field number is just a string for identifying the document in another database. As I've said, this should return a list with roughly 60k strings. Nothing very large. Yet, it's taking a very long time to run (more than 10min). Is this normal in DocumentDB? What might be going on? When using a MongoDB locally in my machine, this used to be way faster.

0 Answers
Related