0

I'm using MongoDB Compass as GUI for the database.

I'm trying to filter where title does not begin with p, I have this in the filter field - which is straight from the mongodb docs:

{ title: { $not: /^p.*/ } }

However, the 'Find' button is still disabled... what am I doing wrong?

Thanks

Jat90
  • 493
  • 1
  • 10
  • 22

1 Answers1

1

try using $regex and the "not starts with p" pattern

{ title: {"$regex": "^(?!p)"} }
Matt Wang
  • 318
  • 1
  • 10