diff --git a/src/Capsule/Collection.php b/src/Capsule/Collection.php index de37dd8..ad51e13 100644 --- a/src/Capsule/Collection.php +++ b/src/Capsule/Collection.php @@ -206,7 +206,7 @@ private function prepareQuery(string $method, $filters, $data, array $options): private function translateReadPreference(ReadPreference $readPreference): string { - if (version_compare(phpversion('mongodb'), '1.20.0', '>=')) { + if (method_exists(ReadPreference::class, 'getModeString')) { return $readPreference->getModeString(); }