-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Trivial - P5
-
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.