I try to get data from mongoodb by querying find a field name. i use regular expression to get that data. for example if set const name = 'st' then i will get 'steven','stephanie','stella'.
const name = req.params.str;
const user = await User.find({ "name": {$regex:`/${name}/`}});
console.log(user);
i try the code above and the result is null