MongoDB\Driver\Manager::executeReadCommand

(mongodb >=1.4.0)

MongoDB\Driver\Manager::executeReadCommandExecute a database command that reads

Beschreibung

final public MongoDB\Driver\Manager::executeReadCommand(string $db, MongoDB\Driver\Command $command, array $options = array()): MongoDB\Driver\Cursor

Selects a server according to the "readPreference" option and executes the command on that server. By default, the read preference from the MongoDB Connection URI will be used.

This method will apply logic that is specific to commands that read (e.g. » count) and take the MongoDB server version into account. The "readConcern" option will default to the corresponding value from the MongoDB Connection URI.

Parameter-Liste

db (string)

The name of the database on which to execute the command.

command (MongoDB\Driver\Command)

The command to execute.

options

options
Option Type Description
readConcern MongoDB\Driver\ReadConcern

A read concern to apply to the operation.

This option is available in MongoDB 3.2+ and will result in an exception at execution time if specified for an older server version.

readPreference MongoDB\Driver\ReadPreference

A read preference to use for selecting a server for the operation.

session MongoDB\Driver\Session

A session to associate with the operation.

Warnung

If you are using a "session" which has a transaction in progress, you cannot specify a "readConcern" or "writeConcern" option. This will result in an MongoDB\Driver\Exception\InvalidArgumentException being thrown. Instead, you should set these two options when you create the transaction with MongoDB\Driver\Session::startTransaction().

Rückgabewerte

Returns MongoDB\Driver\Cursor on success.

Fehler/Exceptions

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...

admin

Autor : admin
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Probleme mit speichern in Datenbank in französisch

Das sind zu wenige Informationen, aber wenn ich raten sollte, wurde ich auf Prepare Statements tippen, siehe https://www.php.net/manual/en/mysqli. ...

Geschrieben von Noahenett am 14.02.2025 03:15:14
Forum: PHP Developer Forum
Mehrere Aufträge im Hintergrund ausführen

This solution employs concurrent background calls to execute eight to twelve functions, each requiring 1.5 seconds, then waits until all tasks fin ...

Geschrieben von helgaella99 am 13.02.2025 04:35:26
Forum: PHP Developer Forum
Eingabe in einer Datenbank

In Visual Studio Code kann man Plugins einrichten und dann damit auch PHP-Scripte debuggen.

Geschrieben von scatello am 12.02.2025 11:35:50
Forum: SQL / Datenbanken
Eingabe in einer Datenbank

Immer wieder wichtig: Richtig debuggen Man bemerkt, dass ein Skript nicht das tut, was es soll. Man schreibt an den Anfang des Scriptes die Ze ...

Geschrieben von lyly19 am 12.02.2025 03:32:44
Forum: SQL / Datenbanken