(17) The Book of the Prohibited actions
كتاب الأمور المنهي عنها
(309) Chapter: Prohibition of Spitting in the Mosque
(309) - باب النهي عن البصاق في المسجد والأمر بإزالته منه إذا وجد فيه، والأمر بتنزيه المسجد عن الأقذار
Riyad as-Salihin 1694 
'Aishah (May Allah be pleased with her) said:
The Messenger of Allah (ﷺ) saw spittle or snot or sputum, sticking to the wall towards Qiblah and scratched it off.

[Al-Bukhari and Muslim].

وعن عائشة رضي الله عنها أن رسول الله صلى الله عليه وسلم رأى في جدار القبلة مخاطا أو بزاقا أو نخامة فحكه ‏(‏‏(‏متفق عليه‏)‏‏)‏‏.‏
Reference : Riyad as-Salihin 1694
In-book reference : Book 17, Hadith 184