With 1 variable works perfect:
return '{"name":{"$regex":"^'+value+'", "$options":"i"}}';
But does not work when using 2 or more variables:
return '{"name":{"$regex":"^'+value+'", "$options":"i"}, "brand":{"$regex":"^'+value+'", "$options":"i"}}';