With the release of Studio 3T 5.5 comes Query Code, a powerful feature that allows users to convert MongoDB queries to JavaScript (Node.js), Java (2.x and 3.x driver API), Python, C#, and the mongo shell language.

We’ve also added Query Code to SQL Query, the handy feature that lets you use SQL to query MongoDB; and Aggregation Editor, the convenient feature that breaks down aggregation queries into stages. Now you can translate not just MongoDB queries, but also SQL and aggregation queries to all five languages.

Download Studio 3T now if you still haven’t done so, and let’s begin.

Download Studio 3T
Get Download Link for Later

Visual Query Builder

  1. Simply query as you normally would using Visual Query Builder and check that it gives you the desired results. (Hint: With Release 5.4.0, you can now even drag multiple fields at once!)
  2. This time, you’ll notice one very simple (but powerful) tab: Query Code. Click on it.Query Code is the headline feature of Studio 3T Release 5.5.0
  3. Choose your target language from the dropdown. Query Code currently supports Javascript (Node.js), Java(2.x and 3.x driver API), Python, C#, and mongo shell, but extensions are in the pipeline and we’re open to your suggestions.
    With Query Code you can translate MongoDB queries to your app's native language
  4. Click Copy code to clipboard.Convert MongoDB query to JavaScriptOnce that’s done, paste it into your application – and done! You can of course tweak the code as you like, but Studio 3T’ll take care of the hard work for you from now on.

SQL Query

Same as with the Visual Query Builder, start SQL Query as you normally would and write your SQL query.

Click on the Query Code tab and follow the same steps as above.

SQL Query, the feature which lets you use SQL to query MongoDB, now also comes with Query Code

We hope you enjoy using Query Code, our new feature that lets you automatically generate driver code in four easy steps within our app.

In the meantime, why not read up on how to export MongoDB to SQL or these handy tips for SQL users new to MongoDB.

If SQL doesn’t tickle your fancy, it never hurts to brush up on other Studio 3T time-saving tips and best practices.

As always, please feel free to drop us a line; we’d love to hear your thoughts.

Try Query Code
Get Download Link for Later

Happy querying 🙂