-1

So I have a big MongoDB database with like 2358 documents. Whenever I try to query it takes a long period of time and sometimes when I go to the dashboard and try to get the data it shows me this: Image of MongoDB error

I don't know how to fix it and I need it for a project I am doing. The programming language I am using is Python and I am using the pymongo library. I don't know if it matters but I am using repl.it to run my code

Hackermon
  • 78
  • 1
  • 7
  • 1
    Welcome - this is a pretty small database, to be honest - would it be possible to post your queries? – aronchick May 14 '20 at 20:10
  • @aronchick Sorry, I am a noob at MongoDB but what is a query? Is it like a document on the collections or ??? – Hackermon May 14 '20 at 20:14
  • Your query is the actual string you hand to Mongo to get a bunch of responses. Based on this, it sounds like the dashboard error is not the issue here. – aronchick May 14 '20 at 20:42
  • @aronchick Does the query really matter tho? It takes a long time for it to load for any query I put in – Hackermon May 14 '20 at 20:50
  • Try running one of your queries using the [explain](https://docs.mongodb.com/manual/reference/command/explain/index.html#explain) database command with the "executionStats" verbosity. The output from that will help determine what is going on. – Joe May 15 '20 at 00:07

1 Answers1

-1

It turns out it was my fault. I wasn't using a query and I was just extracting all the documents from my collection at once. So the lesson is: use a query

Hackermon
  • 78
  • 1
  • 7