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'
}
}

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