mashingan / anonimongo

Another Nim pure Mongo DB driver
MIT License
43 stars 5 forks source link

Driver prints "Server support compressions" in console, why? #17

Closed al6x closed 3 years ago

al6x commented 3 years ago

After connection driver prints

Server support compressions: @[]

From this line in sources

Why?

mashingan commented 3 years ago

Mostly no reason.

For legitimate reason, it's a way to know what the compressions are supported by mongodb server, This information is returned from mongodb after handshake so the info just printed out to console. Another reason too I need to see this information for adding compressions support.

Is the console print misleading? Since it's just information I could remove it or only print if the driver compiled when verbose.

al6x commented 3 years ago

Thanks for explanation. It's not misleading, just unexpected. I used MongoDB in Node.JS and never saw that message, so was surprised when I saw it with Nim driver and was not sure what it means.

I personally would prefer to not print it (printing in verbose mode only looks also like a good option), or maybe return it as the return string value from the new_mongo function.

mashingan commented 3 years ago

Alright, the print would be only in verbose mode. The compressions info itself actually can be checked from mongo object as it's exported field, so this console print should be not necessary anymore.

Thanks for the notice.