كتاب الجهاد والسير
32  
The Book of Jihad and Expeditions
(40)
Chapter: The supplication of the Prophet (saws) and his steadfastness in the face of the hypocrites' persecution
(40)
باب فِي دُعَاءِ النَّبِيِّ صلى الله عليه وسلم إِلَى اللَّهِ وَصَبْرِهِ عَلَى أَذَى الْمُنَافِقِينَ
Sahih Muslim 1798 b

A similar tradition has been narrated through a different chain of transmitters by Ibn Shihab with the addition of the words:

" Before Abdullah (b. Ubayy) became a Muslim."
حَدَّثَنِي مُحَمَّدُ بْنُ رَافِعٍ، حَدَّثَنَا حُجَيْنٌ، - يَعْنِي ابْنَ الْمُثَنَّى - حَدَّثَنَا لَيْثٌ، عَنْ عُقَيْلٍ، عَنِ ابْنِ شِهَابٍ، فِي هَذَا الإِسْنَادِ بِمِثْلِهِ وَزَادَ وَذَلِكَ قَبْلَ أَنْ يُسْلِمَ عَبْدُ اللَّهِ ‏.‏
Reference : Sahih Muslim 1798b
In-book reference : Book 32, Hadith 142
USC-MSA web (English) reference : Book 19, Hadith 4432
  (deprecated numbering scheme)