The text details the enhancements introduced in Couchbase Server version 6.5 regarding N1QL's ANSI JOIN and MERGE functionalities. Initially, N1QL's ANSI JOIN required the right-hand side to be a keyspace, a restriction lifted in version 6.5, allowing expressions and subqueries to be used instead, thus facilitating more flexible query operations. These modifications improve N1QL's ANSI compliance and usability, particularly in migrating from relational databases. Additionally, Couchbase 6.5 introduces support for ANSI MERGE, which allows for more sophisticated merging operations based on arbitrary expressions rather than solely on document keys, expanding the functionality beyond the previous ON KEYS clause. The text also explains the introduction of hash joins as the default method for expressions or subqueries in ANSI JOIN, the handling of multiple matches in ANSI MERGE, and the requirement for specifying document keys in INSERT actions within ANSI MERGE. These updates aim to make N1QL more user-friendly and versatile, aligning its capabilities more closely with those of traditional SQL in relational databases.