ee.Reducer.group
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ตัวลดกลุ่มจะบันทึกตามค่าของอินพุตที่ระบุและลดแต่ละกลุ่มด้วยตัวลดที่ระบุ
การใช้งาน | การคืนสินค้า |
---|
Reducer.group(groupField, groupName) | ตัวลดตำแหน่ง |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ reducer | ตัวลดตำแหน่ง | ตัวลดที่จะใช้กับแต่ละกลุ่มโดยไม่มีฟิลด์กลุ่ม |
groupField | จำนวนเต็ม ค่าเริ่มต้น: 0 | ฟิลด์ที่มีกลุ่มระเบียน |
groupName | สตริง ค่าเริ่มต้น: "group" | คีย์พจนานุกรมที่มีกลุ่ม ค่าเริ่มต้นคือ "group" |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eGroups records based on a specified field, creating separate groups for each unique value in that field.\u003c/p\u003e\n"],["\u003cp\u003eApplies a given reducer function to each group of records, effectively reducing each group to a single result.\u003c/p\u003e\n"],["\u003cp\u003eAssigns the original reducer to process individual records within each group, excluding the grouping field itself.\u003c/p\u003e\n"],["\u003cp\u003eOrganizes the grouped data within a dictionary-like structure, using 'group' as the default key to access the grouped records.\u003c/p\u003e\n"]]],["The `Reducer.group` function groups records based on a specified `groupField` (defaulting to field 0). It then applies a provided `reducer` to each group, excluding the grouping field. The result of the reducer on each group is stored under a `groupName` key (defaulting to \"group\"). The function itself returns a `Reducer` object. The `groupField` type can be an Integer.\n"],null,["# ee.Reducer.group\n\nGroups reducer records by the value of a given input and reduces each group with the given reducer.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------------------------------------|---------|\n| Reducer.group`(`*groupField* `, `*groupName*`)` | Reducer |\n\n| Argument | Type | Details |\n|-----------------|--------------------------|------------------------------------------------------------------|\n| this: `reducer` | Reducer | The reducer to apply to each group, without the group field. |\n| `groupField` | Integer, default: 0 | The field that contains record groups. |\n| `groupName` | String, default: \"group\" | The dictionary key that contains the group. Defaults to 'group'. |"]]