The Messenger of Allah ﷺ said when we had formed our ranks on the day of Badr, "When they draw near you, meaning when they overwhelm you, shoot them with arrows, but conserve your arrows."
حدثنا أحمد بن سنان حدثنا أبو أحمد الزبيري حدثنا عبد الرحمن بن سليمان بن الغسيل
قال رسول الله ﷺ حين اصطففنا يوم بدر إذا أكثبوكم يعني إذا غشوكم فارموهم بالنبل واستبقوا نبلكم
Bukhari transmitted it in his chapter on military campaigns, in the chapter after the chapter on the merit of those who witnessed Badr, hadith no. 3984, 3985, from the hadith of Abu Ahmad Zubayri through this same route.