ee.Join.saveFirst
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trả về một phép kết hợp ghép nối từng phần tử trong tập hợp đầu tiên với một phần tử phù hợp trong tập hợp thứ hai. Kết quả trùng khớp đầu tiên sẽ được thêm vào kết quả dưới dạng một thuộc tính bổ sung.
Cách sử dụng | Giá trị trả về |
---|
ee.Join.saveFirst(matchKey, ordering, ascending, measureKey, outer) | Tham gia |
Đối số | Loại | Thông tin chi tiết |
---|
matchKey | Chuỗi | Tên cơ sở lưu trú dùng để lưu kết quả so khớp. |
ordering | Chuỗi, mặc định: null | Thuộc tính dùng để sắp xếp các kết quả khớp trước khi chọn kết quả đầu tiên. |
ascending | Boolean, mặc định: true | Liệu thứ tự có tăng dần hay không. |
measureKey | Chuỗi, mặc định: null | Tên thuộc tính không bắt buộc dùng để lưu chỉ số của điều kiện kết hợp trên kết quả khớp. |
outer | Boolean, mặc định: false | Nếu đúng, các hàng chính không có kết quả trùng khớp sẽ được đưa vào kết quả. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eThis function joins two collections by pairing elements based on matching property values.\u003c/p\u003e\n"],["\u003cp\u003eIt prioritizes the first match encountered and appends it as an additional property to the primary collection.\u003c/p\u003e\n"],["\u003cp\u003eUsers can specify sorting criteria for the matches using \u003ccode\u003eordering\u003c/code\u003e and \u003ccode\u003eascending\u003c/code\u003e parameters.\u003c/p\u003e\n"],["\u003cp\u003eOptionally, it allows saving the measure of the join condition and includes primary rows without matches if \u003ccode\u003eouter\u003c/code\u003e is true.\u003c/p\u003e\n"]]],["The `ee.Join.saveFirst` function creates a join between two collections, pairing each element from the first with its first matching element from the second. The matched element is stored as a new property, specified by `matchKey`. Matches can be sorted by `ordering` in `ascending` order before the first is selected. `measureKey` can be used to save the measurement of the join. Setting `outer` to true includes unmatched primary rows.\n"],null,["# ee.Join.saveFirst\n\nReturns a join that pairs each element from the first collection with a matching element from the second collection. The first match is added to the result as an additional property.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------------------------------------------------------|---------|\n| `ee.Join.saveFirst(matchKey, `*ordering* `, `*ascending* `, `*measureKey* `, `*outer*`)` | Join |\n\n| Argument | Type | Details |\n|--------------|-------------------------|----------------------------------------------------------------------------------------|\n| `matchKey` | String | The property name used to save the match. |\n| `ordering` | String, default: null | The property on which to sort the matches before selecting the first. |\n| `ascending` | Boolean, default: true | Whether the ordering is ascending. |\n| `measureKey` | String, default: null | An optional property name used to save the measure of the join condition on the match. |\n| `outer` | Boolean, default: false | If true, primary rows without matches will be included in the result. |"]]