diff --git a/website/www/site/content/en/documentation/programming-guide.md b/website/www/site/content/en/documentation/programming-guide.md index 13900f3a7ceb..45c4af52da92 100644 --- a/website/www/site/content/en/documentation/programming-guide.md +++ b/website/www/site/content/en/documentation/programming-guide.md @@ -4229,6 +4229,15 @@ output_pc = input_pc | beam.Select(post_code=lambda item: str(item["shipping_add Support for wildcards hasn't been developed for the Python SDK yet. {{< /paragraph >}} +<< paragraph class="language-py" >> +Example of selecting all nested fields using wildcard: +<< /paragraph >> + +<< highlight py >> +input_pc = ... +output_pc = input_pc | beam.Select("shippingAddress.*") +<< /highlight >> + {{< paragraph class="language-go">}} Support for wildcards hasn't been developed for the Go SDK yet. {{< /paragraph >}} @@ -4259,6 +4268,15 @@ selected, the result is an array of the selected subfield type. For example Support for Array fields hasn't been developed for the Python SDK yet. {{< /paragraph >}} +{{< paragraph class="language-py" >}} +example of selecting a nested field inside an array: +{{< /paragraph >}} + +<< highlight py >> +input_pc = ... +output_pc = input_pc | beam.Select("transactions[].bank") +<< /highlight py >> + {{< paragraph class="language-go">}} Support for Array fields hasn't been developed for the Go SDK yet. {{< /paragraph >}} @@ -4287,6 +4305,15 @@ arrays, the use of {} curly brackets in the selector is recommended, to make it selected, they can be omitted for brevity. In the future, map key selectors will be supported, allowing selection of specific keys from the map. For example, given the following schema: +<< paragraph class="language-py" >> +Example of selecting a specific key from a map field: +<< /paragraph >> + +<< highlight py >> +input_pc = ... +output_pc = input_pc | beam.Select("purchasesByType['electronics']") +<< /highlight >> + **PurchasesByType**