Skip to content

Commit 8ce64fc

Browse files
committed
In 4.0.6 and earlier, you could use $not operator with regular expression objects (i.e. /pattern/) but not with $regex operator expressions.
1 parent 7c34685 commit 8ce64fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exporter/currentop_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (d *currentopCollector) collect(ch chan<- prometheus.Metric) {
8484
{Key: "op", Value: bson.D{{Key: "$ne", Value: ""}}},
8585
{Key: "ns", Value: bson.D{
8686
{Key: "$ne", Value: ""},
87-
{Key: "$not", Value: bson.D{{Key: "$regex", Value: "^admin.*|^local.*"}}},
87+
{Key: "$regex", Value: "/^(?!(admin|local)).*/"},
8888
}},
8989
}
9090
res := client.Database("admin").RunCommand(d.ctx, cmd)

0 commit comments

Comments
 (0)