Accurately save queries
When I write a query that has a $regex and then try to favorite/save that query, Compass changes the favorited query. For example, this simple query returns results:
{
customerNumber: {
$regex: "MSHA1",
},
_partitionKey: { $ne: "INACTIVE" }
}
However, if I then check my query history to so I can favorite it, my history shows this query that returns no results:
{
customerNumber: {
pattern: 'MSHA1',
options: ''
},
_partitionKey: {
$ne: 'INACTIVE'
}
}
![](https://secure.gravatar.com/avatar/aa33df7cfc7b686917b62223b4c0c86e?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
We have a PR up to fix this: https://github.com/mongodb-js/devtools-shared/pull/353/files
-
AdminBetsy (Admin, MongoDB) commented
Thank you so much for bringing this bug to our attention. I was able to reproduce it, and I've filed a bug ticket for the team to take a look: https://jira.mongodb.org/browse/COMPASS-7979