I want to filter the data from db with the help of regex that count the digits.i have a regex that count digits but its not working in mongodb query getting some error or empty result.regex is below "^(\d {1})$" . Don't know how to how to use this regex in the mongodb query.anyone can help ? Thanks
let regex = new RegExp("^(\d {1})$", 'i');
return placeStorage.list({ price: { $regex: regex } })
.then(places => {
return places
})
i want the result that inculdes the places which have the price digit according the digit in the regex. for example if put 99 then it should return the value that includes the price which have price with maximum 2 digits like 99 or below this not more than this like 100 or more than this should not be return