  We study composition operators of characteristic zero on weighted Hilbert
spaces of Dirichlet series. For this purpose we demonstrate the existence of
weighted mean counting functions associated with the Dirichlet series symbol,
and provide a corresponding change of variables formula for the composition
operator. This leads to natural necessary conditions for the boundedness and
compactness. For Bergman-type spaces, we are able to show that the compactness
condition is also sufficient, by employing a Schwarz-type lemma for Dirichlet
series.
