Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2826

Parse filter query before attempting database connection

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 1,123

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: