Mongodb – Regex How can I find names only written in upper-case letters(mandatory), and the names may also contain numbers, literal spaces, and hyphens
If I want to find "KFC", "EU 8RF", and IK-OTP simultaneously, what should the code look like? My code is : db.business.find({name:/^[A-Zs?d?-?]*$/}, {name:1}).sort({"name":1}) but it will return the name that is whole number, such as 1973, 1999. How should I…