public function type($type)
{
if (is_string($type)) {
$map = ['double' => 1, 'string' => 2, 'object' => 3, 'array' => 4, 'binary' => 5, 'undefined' => 6, 'objectid' => 7, 'boolean' => 8, 'date' => 9, 'null' => 10, 'regex' => 11, 'jscode' => 13, 'symbol' => 14, 'jscodewithscope' => 15, 'integer32' => 16, 'timestamp' => 17, 'integer64' => 18, 'maxkey' => 127, 'minkey' => 255];
$type = isset($map[$type]) ? $map[$type] : $type;
}
return $this->operator('$type', $type);
}