Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-170

Log entries should be Javascript code runnable from Mongo console (when possible)

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      any

      Most SQL drivers log pure SQL statements. This is very useful when you need to debug something or experiment with a query in db's console.

      Currently Ruby MongoDB driver logs something that looks like Ruby (it uses string interpolation and #inspect to construct messages). When you need to run a query from the log in the console, you need to translate the code to Javascript by hand, especially hashes.

      The ideal situation would be to see Javascript code in the log, so that it's just copy-paste to Mongo console to run it.

      Ruby 1.9 has a json lib built-in, but I wonder if there's any other JSON emitter build in currently? If yes, then it'd be easy to implement, otherwise a dependency would have to be added for 1.8.

            Assignee:
            kbanker Kyle Banker
            Reporter:
            w.piekutowski Wojciech Piekutowski
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: