Remplaced options.type with options.template. Set template when calling that function.
Use $in operator instead.