Data migration from relational databases like SQL Server or Oracle to Couchbase presents challenges, particularly in denormalizing documents to fit the target data model. Couchbase Server 7.0, with its scopes and collections, facilitates document organization within a bucket, enhancing the migration process. One-to-one mapping, where each RDBMS table is imported as a Couchbase collection, is straightforward using cbimport. However, many-to-one mapping, where multiple RDBMS tables are merged into a single Couchbase document, requires denormalization, which can be achieved at the source, middle layer, or destination. The article details how to use SQL++ queries, known as N1QL, to merge and denormalize documents within Couchbase, demonstrating the process with a sample database. The final goal is to achieve a target data model by merging multiple tables into nested documents, using N1QL queries and appropriate indexing, and optionally cleaning up redundant collections after successful denormalization.