Find all data starts with specific letter

I want to know how can I find all data starts with specific letter
exemple:
name="you"
name="yaw"
name="yes"
thanks for help

const someLetter = 'y';
const pattern = new RegExp(`^${someLetter}`);
const results = People.find({ name: pattern });
1 Like

thanks for help, your solution work too well