I’m attempting to write something that enables me to see the raw response that is returned from mongo. Essentially, we run pipeline aggregations with many different data types - none of them a specific kind. Sometimes, it’s difficult to tell why the result isn’t unpacking cleanly into the result struct. In these cases, I’m attempting to create a debug mode that will print out the raw response from mongo (in the same format that you see on the mongo CLI essentially when you run a query - or something close).
Then you would be able to see what mongo is returning and adjust your query or data type accordingly.
I’ve run into a couple problems though - Ultimately, what should I be using to do this? Is there some kind of unmarshaller can I use to accomplish this perhaps? Is there a generic hook for all data types or perhaps I could call the default marshaller function at the end of this function?
Any guidance would be appreciated.