if (source?.$and) {
    source.$and = cleanAnd(source.$and as Record<string, unknown>[]);
    if (!source.$and) {
      delete source.$and;
    }