
MongoDBDriverManager::executeCommand() 메서드는 deprecated되었으며, 대신 MongoDB\Client::executeCommand() 메서드를 사용하십시오.
#hostingforum.kr
php
use MongoDBClient;
$client = new Client("mongodb://localhost:27017");
$result = $client->executeCommand("test", ['ping' => 1]);
위 코드에서 "test"은 데이터베이스 이름입니다.
또한, MongoDB 3.10.4 버전은 deprecated된 메서드를 사용하는 것을 권장하지 않습니다. 최신 버전의 MongoDB를 사용하는 것을 권장합니다.
2025-03-28 16:00