Using the latest version (2.14) is there any way to view the bson query document generated by a specific linq query?
I want to do this for two reasons:
I know I can enable profiling, but I can't see any way to guarantee a query you find in the mongo log was generated by a specific line of code or query. Plus it's a bit long winded to do it via profiling.
You have 2 options to get MQL query from LINQ request:
CommandStartedEvent
event subscriber and analyze Command
document. Pay attention that you may need to remove some technical fields like $db
(maybe few more) that might not be parsed by compass correctly, you will see it in the exception message if any.UPDATE:
3. You can also use ILogger
implementation. You can find details here