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

Parse filter query before attempting database connection

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Accepted
    • Priority: Trivial - P5
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            oleg.pudeyev Oleg Pudeyev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: