Hi @max_matinpalo, you can use .explain() method in your node.js app, but the following will never work, not even in the MongoDB shell:
You can use the following syntax to get the explain results in your result variable:
const result = await db.collection("Users").find().explain()
also,
const result = await db.collection("Users").aggregate([<---Your Pipeline--->]).explain()
I hope it helps.
In case you have any doubts, please feel free to reach out to us.
Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer