This matches with any fieldName that includes the string:$mongoRegex = new MongoDB\BSON\Regex("$string", "i");This matches with any fieldName that STARTS with the string:$mongoRegex = new MongoDB\BSON\Regex("^$string", "i");$cursor = $collection->find( [ 'fieldName' => $mongoRegex ] );$docs = [];foreach($cursor as $doc){ $docs[] = $doc;}return $docs;