Skip to content

Instantly share code, notes, and snippets.

@HaykoKoryun
Created November 20, 2017 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HaykoKoryun/546860d28fe33a32dc034a36938ceb1f to your computer and use it in GitHub Desktop.
Save HaykoKoryun/546860d28fe33a32dc034a36938ceb1f to your computer and use it in GitHub Desktop.
$manager = new \MongoDB\Driver\Manager("mongodb://user:pass@domain.com:27017/central?readPreference=secondary");
$command = new \MongoDB\Driver\Command(['explain' => ['find' => 'zztop']]);
$cursor = $manager->executeCommand('central', $command);
$response = $cursor->toArray()[0];
print_r($response);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment