Using $regex to filter documents by a referenced document field

Uh sorry, I gave the wrong example. This is the correct example:

const result = await Expense.find({ 'category.name': { $regex: ".*ood.*", $options: 'i' } }).populate<{
	category: CategoryType
}>("category");

console.log("Result: ", result)

My apologies :slight_smile:

1 Like