Selects documents if a field is of the correct type.
		
			Document.field.of_type()
			Document.field.of_type('string')
		
		Element operator: {$type: self.__foreign__}
		Documentation: https://docs.mongodb.org/manual/reference/operator/query/type/#op._S_type

def of_type(self, *kinds):
		"""Selects documents if a field is of the correct type.
		
			Document.field.of_type()
			Document.field.of_type('string')
		
		Element operator: {$type: self.__foreign__}
		Documentation: https://docs.mongodb.org/manual/reference/operator/query/type/#op._S_type
		"""
		
		if self._combining:  # We are a field-compound query fragment, e.g. (Foo.bar & Foo.baz).
			return reduce(self._combining, (q.of_type(*kinds) for q in self._field))
		
		foreign = set(kinds) if kinds else self._field.__foreign__
		
		if not foreign:
			return Filter()
		
		if len(foreign) == 1:  # Simplify if the value is singular.
			foreign, = foreign  # Unpack.
		
		return Filter({self._name: {'$type': foreign}})