Company
Date Published
Author
Nic Raboy, Developer Advocate, Couchbase
Word count
1458
Language
English
Hacker News points
None

Summary

The Go programming language is used to interact with Couchbase Server 4.5+ using the Couchbase Go SDK. A data story for a user profile document with social media information is presented, focusing on manipulations around the social media information. The project starts by creating a connection to a locally running Couchbase cluster and opening the default bucket. A `Person` structure is defined to represent the basic user information, along with a nested `SocialNetworking` structure for social media details. The main function creates an initial data structure, and then uses functions such as `createDocument`, `getDocument`, `getSubDocument`, and `upsertSubDocument` to manipulate the document. These functions demonstrate how to work with fragments of documents using the Couchbase Server Sub-Document API.