  A search for the decays $B^0_s\to e^+e^-$ and $B^0\to e^+e^-$ is performed
using data collected with the LHCb experiment in proton-proton collisions at
center-of-mass energies of $7$, $8$ and $13\,\text{TeV}$, corresponding to
integrated luminosities of $1$, $2$ and $2\,\text{fb}^{-1}$, respectively. No
signal is observed. Assuming no contribution from $B^0\to e^+e^-$ decays, an
upper limit of $\mathcal{B}(B^0_s\to e^+e^-)<9.4\,(11.2)\times10^{-9}$ is
obtained at $90\,(95)\,\%$ confidence level. If no $B^0_s\to e^+e^-$
contribution is assumed, a limit of $\mathcal{B}(B^0\to
e^+e^-)<2.5\,(3.0)\times10^{-9}$ is determined at $90\,(95)\,\%$ confidence
level. These upper limits are more than one order of magnitude lower than the
previous values.
