24

I'm using MongoDB Compass to perform an aggregation on a reasonably large dataset (~2,000,000 documents, 300MB) through an SSH tunnel.

It connects fine and I can query but stages in my pipeline appear to timeout operation exceeded time limit.

enter image description here

I know via the command line you can set the max time in milliseconds for a query using maxTimeMs $maxTimeMS but is it possible to apply this in MongoDB Compass?

I have also looked for connection timeout settings and can't find anything related to that in the GUI.

Evan Gertis
  • 1,796
  • 2
  • 25
  • 59
Dan
  • 11,914
  • 14
  • 49
  • 112
  • I've just managed to fix the above by moving the $match to happen first but this question still applies – Dan Apr 04 '19 at 07:47
  • 1
    having the same issue with aggregate. Is it possible to change timeout setting? – Vlad Vinnikov May 03 '19 at 23:09
  • I've found in `/usr/share/mongodb-compass-community-beta/resources/app.asar` that there is a constant `const DEFAULT_MAX_TIME_MS = 10000;`. I have tried to unpack the `asar` file and succeed, and then found two files where the constant appears. But I found no way to rebuild the `app.asar` file. – Orelsanpls Jul 03 '19 at 13:39
  • I've open a ticket on mongoDB JIRA : https://jira.mongodb.org/browse/COMPASS-3753 – Orelsanpls Jul 03 '19 at 13:58

2 Answers2

17

In Compass 1.19-beta we added an option to set maxTimeMS in the aggregation pipeline builder and in the query bar.

Compass 1.19 agg builder options

  • Looks a little different in the non-beta version 1.19.12 (1.19.12) which you can find by clicking options to the right of the filter search bar and `MAXTIMEMS` will be there. – leeman24 Oct 23 '19 at 18:30
  • Does this timeout apply to the "Explain Plan" tab? It doesn't appear to. Is there a way to extend that timeout? – Kleinux Nov 01 '19 at 15:11
  • For Explain plan (and similarly, for Schema and regular queries in the Documents tab), you have a maxTimeMS field in the query bar. Click on Options to expand it and see all the options. – Massimiliano Marcon Nov 04 '19 at 08:27
11

To anyone came here to fix this problem on other tabs.

in filter search click on options when it expands, change MAXTIMEMS to any second you want, the value must be in millisecond.

then you can use FIND, ANALYZE or EXPLAIN depends on the tab you chose.

mongodb compass

ttrasn
  • 4,322
  • 4
  • 26
  • 43