How can one best debug N1QL queries

In Mssql there is tools which allow me to debug or at least monitor what query was send to the server. This is specially helpful when sending the query from an app like nodeJS and something goes wrong like the value passes is string vs numeric etc. while using a template with $ place holders. Is there anywhere on server or so where I can see the full query with populated values to troubleshoot issues ?

See: https://dzone.com/articles/query-performance-monitoring-made-easy-with-couchb

Also Checkout Chapters of https://blog.couchbase.com/wp-content/uploads/2017/10/N1QL-A-Practical-Guide-2nd-Edition.pdf

  1. Optimize N1QL Performance Using Request Profiling
  2. Query Performance Monitoring Made Easy With Couchbase N1QL