PHP Doku:: Gets a collection - mongodb.get.html

Verlauf / Chronik / History: (5) anzeigen

Sie sind hier:
Doku-Startseite ≥ PHP-Handbuch ≥ Funktionsreferenz ≥ Datenbankerweiterungen ≥ Anbieterspezifische Datenbankerweiterungen ≥ MongoDB Native Driver ≥ Core Classes ≥ The MongoDB class ≥ MongoDB::__get

Ein Service von Reinhard Neidl - Webprogrammierung.

The MongoDB class

<<MongoDB::forceError()

MongoDB::getDBRef>>

MongoDB::__get

(PECL mongo >=1.0.2)

MongoDB::__get — Gets a collection

Beschreibung

public MongoCollection MongoDB::__get ( string $name )

This is the easiest way of getting a collection from a database object. If a collection name contains strange characters, you may have to use MongoDB::selectCollection() instead.

<?php

$mongo 
= new Mongo();

// the following two lines are equivalent
$collection = $mongo->selectDB("foo")->selectCollection("bar");
$collection = $mongo->foo->bar;

?>

Parameter-Liste

name

The name of the collection.

Rückgabewerte

Returns the collection.


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)