Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. // This path should point to Composer's autoloader
  2. require_once __DIR__ . "/vendor/autoload.php";
  3. $collection = (new MongoDBClient)->demo->zips;
  4.  
  5. $document = $collection->findOne(['_id' => '94301']);
  6. var_dump($document);
  7. echo ("document = " . $document->name);
  8. C:NetBeansWorkPlacemongoDBplaymongo_010.php:19:
  9. object(MongoDBModelBSONDocument)[13]
  10. private 'storage' (ArrayObject) =>
  11. array (size=5)
  12. '_id' => string '94301' (length=5)
  13. 'city' => string 'PALO ALTO' (length=9)
  14. 'loc' =>
  15. object(MongoDBModelBSONArray)[12]
  16. private 'storage' (ArrayObject) =>
  17. array (size=2)
  18. ...
  19. 'pop' => int 15965
  20. 'state' => string 'CA' (length=2)
  21.  
  22. C:NetBeansWorkPlacemongoDBplaymongo_003.php:16:
  23. object(MongoDBModelDatabaseInfo)[4]
  24. public 'name' => string 'databaseName' (length=12)
  25. public 'sizeOnDisk' => float 83886080
  26. public 'empty' => boolean false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement