瀬島 貴則(グリー株式会社)「MySQLやSSDとかの話・前編」
MySQL User Conference Tokyo 2015での登壇資料です
https://www.mysql.com/news-and-events/events/mysql-user-conference-tokyo-2015/
瀬島 貴則(グリー株式会社)「MySQLやSSDとかの話・前編」
MySQL User Conference Tokyo 2015での登壇資料です
https://www.mysql.com/news-and-events/events/mysql-user-conference-tokyo-2015/
The document discusses iterating through the leaf nodes of a nested document structure. It introduces the forEachLeafNode() method, which allows iterating through just the leaf nodes (those with no child nodes) in one pass, rather than requiring multiple nested loops. This is more efficient for traversing large, deeply nested documents than recursively iterating child nodes. Examples are given showing how to access the node values and path arrays using the leaf node objects.
The document discusses iterating through the leaf nodes of a nested document structure. It explains that using forEachLeafNode allows iterating through just the terminal nodes with values in one pass, rather than requiring multiple nested loops to traverse the entire structure. forEachLeafNode calls a callback function, passing the value and leaf node object for each terminal node. This avoids inefficiently traversing all nodes and allows early termination by returning true from the callback.