Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
muslim:2479bʿAbdullāh b. ʿAbd al-Raḥman al-Dārimī > Mūsá b. Khālid Khatan al-Firyābī > Abū Isḥāq al-Fazārī > ʿUbaydullāh b. ʿUmar > Nāfiʿ > Ibn ʿUmar

I used to spend nights in the mosque and by that time I had no wife and children. I saw in a dream as if I am being taken to a well. I made a mention of it to Messenger of Allah (may peacebe upon him). The rest of the hadith is the same.  

مسلم:٢٤٧٩bحَدَّثَنَا عَبْدُ اللَّهِ بْنُ عَبْدِ الرَّحْمَنِ الدَّارِمِيُّ أَخْبَرَنَا مُوسَى بْنُ خَالِدٍ خَتَنُ الْفِرْيَابِيِّ عَنْ أَبِي إِسْحَاقَ الْفَزَارِيِّ عَنْ عُبَيْدِ اللَّهِ بْنِ عُمَرَ عَنْ نَافِعٍ عَنِ ابْنِ عُمَرَ قَالَ

كُنْتُ أَبِيتُ فِي الْمَسْجِدِ وَلَمْ يَكُنْ لِي أَهْلٌ فَرَأَيْتُ فِي الْمَنَامِ كَأَنَّمَا انْطُلِقَ بِي إِلَى بِئْرٍ فَذَكَرَ عَنِ النَّبِيِّ ﷺ بِمَعْنَى حَدِيثِ الزُّهْرِيِّ عَنْ سَالِمٍ عَنْ أَبِيهِ