protected function setReadPreferenceToPrimary()
    {
        // Set db preference
        /** @var ReadPreference $dbReadPref */
        $dbReadPref = $this->getDatabase()->__debugInfo()['readPreference'];

        $dbPref = $dbReadPref->getMode();
        $dbTagsets = $dbReadPref->getTagsets();

        $this->originalDbReadPreference = $this->db->__debugInfo()['readPreference']->getMode();
        if ($dbPref !== ReadPreference::RP_PRIMARY) {
            $this->db = $this->db->withOptions(array('readPreference' => new ReadPreference(ReadPreference::RP_PRIMARY, $dbTagsets)));
        }

        /** @var ReadPreference $collReadPref */
        $collReadPref = $this->getCollection()->__debugInfo()['readPreference'];
        $collPref = $collReadPref->getMode();
        $collTagsets = $collReadPref->getTagsets();

        // Set collection preference
        $this->originalCollectionReadPreference = $collPref;
        if ($collPref !== ReadPreference::RP_PRIMARY) {
            $this->collection = $this->collection->withOptions(array('readPreference' => new ReadPreference(ReadPreference::RP_PRIMARY, $collTagsets)));
        }
    }