Re-run a query from the profiler tab
When using the profiler tab, if there is a $regex expression specified, it comes back in the logs as $regularExpression. Similar issues for ObjectID() vs generated $oid.
For some reason, you can’t take the query the profiler outputs and just plug it back in to mongo. You have to manipulate it.
Displaying a valid query from the profiler tab in which I could either click “Open query in aggregation viewer” and open the aggregation pane for that collection with this query pre-populated, and/ allow easy copy+pasting of a valid query elsewhere.
The first thing I've been doing with query optimization is to start by taking that slow query and plugging it in as-is, then manipulating it and play with indexes. Having the ability to just click the query from the profiler and immediately go to the collection and re-run that same query would speed up that workflow so much.
![](https://secure.gravatar.com/avatar/e4d9c1a88e443ad4d14f28f306c4ba67?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)