Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Under Consideration
Categories Compass
Created by Guest
Created on Jun 6, 2020

Execute Raw query with query editor

Currently there is no query editor for executing raw queries, like for batch update and batch delete. Consider to add a query editor.
  • Attach files
  • Guest
    Feb 3, 2025
    Hi Rune, thank you for sharing this feedback with my team. I believe this is a duplicate of the raw query editor request that already exists for Compass: https://feedback.mongodb.com/forums/924283-compass/suggestions/40604416-execute-raw-query-with-query-editor I'm going to merge these requests to consolidate them on our feedback portal.
  • Guest
    Jan 28, 2025
    Related: https://feedback.mongodb.com/forums/924283/suggestions/49385867
  • Guest
    Jan 28, 2025
    Current Workflow Pain Points: To debug or work on a query (e.g. this query: db.collection("user").find({name: "bob"}).sort({date: -1})), I currently need to perform multiple steps: 1. Locate and select the relevant collection (which opens a new tab). 2. Enter {name: "bob"} in the query field manually. 3. Open the "Options" dropdown to find the sort field. 4. Enter {date: -1} in the sort field. 5. Click "Find" to execute the query. This process is cumbersome and time-consuming for frequent query modifications or debugging. Proposed Solution: Add a real-time, free-text query interface aimed at advanced users would significantly improve the experience. This feature could: * Automatically re-run the query upon any modifications, streamlining the trial-and-error debugging process. * Support additional functions like .distinct() or other MongoDB operations without requiring cumbersome conversions from .find() to .aggregate() queries. While using the MongoDB shell is a potential workaround, it lacks user-friendliness for live query editing and experimentation. A more intuitive interface would greatly enhance productivity and flexibility. Similar / Related feature requests: * https://feedback.mongodb.com/forums/924283/suggestions/40604416 * https://feedback.mongodb.com/forums/924283/suggestions/44996128
  • Guest
    Nov 27, 2024
    Hi, we are considering building a raw query editor. I would also like to call attention to the bulk update and bulk delete features that were added to Compass earlier this year in version 1.42.0, since that use case was raised in the original request. Here are documentation links describing how to use these features: https://www.mongodb.com/docs/compass/current/documents/modify-multiple/ https://www.mongodb.com/docs/compass/current/documents/delete-multiple/
  • Guest
    Oct 17, 2024
    I have been putting off using Compass as my go-to DB client for lack of this feature, relying instead on other tools. I would love to be able to write my own queries, format them how I like - including all the "options" that force me to click into other text boxes - and execute them - preferably with Ctrl+Enter, as the MongoDB Visual Studio Code Extension does.
  • Guest
    Jul 18, 2024
    Duplicate: https://feedback.mongodb.com/forums/924283-compass/suggestions/44783434-add-a-code-editor-to-save-and-load-mongodb-scripts
  • Guest
    Jul 18, 2024
    This is the main reason why we cannot get rid of our current MongoDB IDE. It's very useful to be able to write javascript code to access MongoDB for various purposes, like creating reports and analyzing the data. Duplicate (with more votes): https://feedback.mongodb.com/forums/924283-compass/suggestions/40604416-execute-raw-query-with-query-editor
  • Guest
    Aug 14, 2023
    IHAC who has requested this feature as well -- their DevOps team has 100+ shell queries that need to be run (validations, reports, etc) and they currently cannot use Compass for this use case.
  • Guest
    Jan 4, 2023
    I'd love to have this feature in MongoDB Compass. It's the only reason I still use another client (Studio3T). When this is implemented, I can see myself switching to Compass.
  • Guest
    Feb 10, 2022
    For now, there is only a shell but why not have an editor with a MongoDB file extension so we can save and load MongoDB scripts like with MySQL Workbench?
  • Guest
    Jan 8, 2021
    Just wanted to mention that MongoDB for VS Code could be a viable option for this, if you are looking for an environment that is more editor based: https://www.mongodb.com/products/vs-code. We are debating whether we should have similar functionality in Compass though.
  • Guest
    Nov 5, 2020
    @Mark I just went there to upvote this and found your reply. I didn't know about NoSQLBooster but it's the GUI I've been looking for... The default theme is a bit ugly but it has a lot a features currently missing on Compass (raw queries, autocompletion, saving favorite scripts, queries history, etc...)
  • Guest
    Oct 21, 2020
    Totally agree. @Massimiliano - no, the embedded shell is nice, but not adequate. You really should study what NoSQLBooster does with their UI. For a professional developer, the most important requirement is that you can cut and paste between your code and the query tool (i.e. Compass). For example, if I'm trying to debug a 100 line aggregation pipeline query, I need to be able to copy that from my code into the tool and immediately start debugging (i.e. editing the query and testing). Until Compass has this capability, I won't consider it. Thanks.
  • Guest
    Jun 15, 2020
    Thinking to have a query editor with auto complete.
  • Guest
    Jun 15, 2020
    Compass 1.22 comes with an embedded shell. Is that close enough to what you are looking for?