Description
$expiry = 300;
|
|
$options = new InsertOptions();
|
$expiryDate = (new \DateTimeImmutable())->modify('+'.$expiry.' seconds');
|
$options->expiry($expiryDate);
|
|
$id = 'doc-01';
|
$document = ['foo' => 'bar'];
|
|
$collection->insert((string) $id, $document, $options);
|
triggers error
terminate called after throwing an instance of 'std::system_error'
|
what(): When specifying expiry as a duration, it must not be longer than 1576800000 seconds, but got 1679609619. If you truly require a longer expiry, please specify it as an time_point instead.: invalid_argument (3)
|
qemu: uncaught target signal 6 (Aborted) - core dumped
|