diff --git a/integration-docdb-to-lambda/example.php b/integration-docdb-to-lambda/example.php new file mode 100644 index 0000000..a093a52 --- /dev/null +++ b/integration-docdb-to-lambda/example.php @@ -0,0 +1,37 @@ +logDocumentDBEvent($record['event']); + } + return 'OK'; + } + + private function logDocumentDBEvent($event): void + { + // Extract information from the event record + + $operationType = $event['operationType'] ?? 'Unknown'; + $db = $event['ns']['db'] ?? 'Unknown'; + $collection = $event['ns']['coll'] ?? 'Unknown'; + $fullDocument = $event['fullDocument'] ?? []; + + // Log the event details + + echo "Operation type: $operationType\n"; + echo "Database: $db\n"; + echo "Collection: $collection\n"; + echo "Full document: " . json_encode($fullDocument, JSON_PRETTY_PRINT) . "\n"; + } +} +return new DocumentDBEventHandler(); \ No newline at end of file