skip to content
Alvin Lucillo

Exec query in js via mongosh

/ 1 min read

💻 Tech

Sometimes, it would be better if you have queries in your .js file instead of entering queries directly via mongosh. For example, you have queries that join multiple documents.

load("/home/user1/query.js")