docs: public static int getTypeForValue( Object value ) {
          if (value == null) return Type.NULL;
          if (value instanceof String) return Type.STRING;
          if (value instanceof Symbol) return Type.SYMBOL;
          if (value instanceof Integer) return Type.INT32;
          if (value instanceof Long) return Type.INT64;
          if (value instanceof Double) return Type.DOUBLE;
          if (value instanceof List) return Type.ARRAY;
          if (value instanceof Document) return Type.DOCUMENT;
          if (value instanceof Boolean) return Type.BOOLEAN;
          if (value instanceof Binary) return Type.BINARY;
          if (value instanceof ObjectId) return Type.OBJECTID;
          if (value instanceof Date) return Type.DATETIME;
          if (value instanceof Null) return Type.NULL;
          if (value instanceof Pattern) return Type.REGEX;
          if (value instanceof Symbol) return Type.DBPOINTER;
          if (value instanceof Code) return Type.JAVASCRIPT;
          if (value instanceof CodeWithScope) return Type.JAVASCRIPT_WITH_SCOPE;
          if (value instanceof Timestamp) return Type.TIMESTAMP;
          if (value instanceof MinKey) return Type.MINKEY;
          if (value instanceof MaxKey) return Type.MAXKEY;
          return Type.UNDEFINED;
      }