-
Type: Task
-
Resolution: Unresolved
-
Priority: Trivial - P5
-
None
-
Affects Version/s: None
-
Component/s: None
-
1,393
If I use mongodump and specify a query via -q, this query appears to be parsed after a successful database connection:
(non-working port:) serene% ~me/debs/mongo/tools/mongodump --port 27017 -q 'hello' -c test -d ruby-driver ^C2021-03-21T08:33:37.616-0400 signal 'interrupt' received; attempting to shut down 2021-03-21T08:33:49.402-0400 Failed: can't create session: could not connect to server: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: localhost:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection() : dial tcp [::1]:27017: connect: connection refused }, ] } (working port:) serene% ~me/debs/mongo/tools/mongodump --port 14700 -q 'hello' -c test -d ruby-driver 2021-03-21T08:33:12.944-0400 Failed: error parsing query as Extended JSON: invalid JSON input
Since the connection may take a while, while the user is waiting for the connection he or she could have fixed the malformed query problem. Instead the users receives no feedback for 30 seconds, then is told that the query is malformed.
As a user of mongodump I would like mongodump to perform the validations it can perform as soon as practical, so that I can address the problems in an expedient manner.