Is there a remote method in Loopback data-juggler or any other loopback component which will let me log the query that is executed by the datasource.
Eg: If i'm using MySQL connector, then when MODEL_NAME.findById() is called, i should be able to get
SELECT * from DATABASE_NAME.MODEL_TABLE where id = WHATEVER_ID
Similarly for MongoDB, it should return equivalent mongo query It'd be great if i am able to log query.explain() of mongo here itself
I've tried running my app as DEBUG=loopback:connector:* node . as suggested here https://groups.google.com/forum/#!topic/loopbackjs/rpii8R8iUkw
It helps, but i'm not able to understand if the query used mongo indexes or not.
Is there a better alternative where i can get response from the datasource and trim it to my requirements? (like just showing if index was used or not)