如需仅保存集合中每个元素的第一个匹配项,请使用 ee.Join.saveFirst()
。saveFirst()
联接的运作方式与 saveAll()
联接等效,但对于 primary
集合中的每个元素,它只会保存与 ee.Filter
中指定的条件匹配的 secondary
集合中的第一个元素。primary
集合中的不匹配元素会被舍弃。除非您提供了排序属性和顺序(如 saveAll 示例中所示),否则保存的第一个元素可能是 saveAll()
使用相同过滤条件在列表中找到的任何元素。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-18。
[null,null,["最后更新时间 (UTC):2025-02-18。"],[[["`ee.Join.saveFirst()` is used to save only the first matching element from a secondary collection to each element in a primary collection."],["It functions similarly to `ee.Join.saveAll()`, but only retains the first match, potentially dropping unmatched primary elements."],["The \"first\" match is arbitrary unless a specific sorting property and order are defined within the join."]]],[]]