|
MongoDB\Driver\WriteConcern::bsonSerializeReturns an object for BSON serialization Beschreibung
final public object MongoDB\Driver\WriteConcern::bsonSerialize
( void
)
Parameter-ListeDiese Funktion hat keine Parameter. RückgabewerteReturns an object for serializing the WriteConcern as BSON. Fehler/Exceptions
BeispieleBeispiel #1 MongoDB\Driver\WriteConcern::bsonSerialize with majority write concern
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
object(stdClass)#2 (1) {
["w"]=>
string(8) "majority"
}
{ "w" : "majority" }
Beispiel #2 MongoDB\Driver\WriteConcern::bsonSerialize with wtimeout and journal
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
object(stdClass)#2 (3) {
["w"]=>
int(2)
["j"]=>
bool(true)
["wtimeout"]=>
int(1000)
}
{ "w" : 2, "j" : true, "wtimeout" : 1000 }
Siehe auch
|