Java NodeJS Python .NET PHP Ruby Scala Go C++ Tools
  • Java API docs
  • Key Value Get
  • Query Rows
  • Query w/ Named Param
  • Query w/ Positional Param
  • Sub-document Lookup
  • Sub-document Mutate
  • Transactions KV Mutate
  • Transactions N1QL
  • Upsert
  • NodeJS API docs
  • Key Value Get
  • Query Rows
  • Query w/ Named Param
  • Query w/ Positional Param
  • Sub-document Lookup
  • Sub-document Mutate
  • Upsert
  • Python API docs
  • Key Value Get
  • Query Rows
  • Query w/ Named Param
  • Query w/ Positional Param
  • Sub-document Lookup
  • Sub-document Mutate
  • Upsert
  • .NET API docs
  • Key Value Get
  • Query Rows
  • Query w/ Named Param
  • Query w/ Positional Param
  • Sub-document Lookup
  • Sub-document Mutate
  • Upsert
  • PHP API docs
  • Key Value Get
  • Query Rows
  • Query w/ Named Param
  • Query w/ Positional Param
  • Sub-document Lookup
  • Sub-document Mutate
  • Upsert
  • Ruby API docs
  • Key Value Get
  • Query Rows
  • Query w/ Named Param
  • Query w/ Positional Param
  • Sub-document Lookup
  • Sub-document Mutate
  • Upsert
  • Scala API docs
  • Key Value Get
  • Query Rows
  • Query w/ Named Param
  • Query w/ Positional Param
  • Sub-document Lookup
  • Sub-document Mutate
  • Upsert
  • Go API docs
  • Key Value Get
  • Query Rows
  • Query w/ Named Param
  • Query w/ Positional Param
  • Sub-document Lookup
  • Sub-document Mutate
  • Upsert
  • C++ API docs
  • Key Value Get
  • Query Rows
  • Query w/ Named Param
  • Query w/ Positional Param
  • Sub-document Lookup
  • Sub-document Mutate
  • Upsert
  • Tools
  • N1QL Query Using curl
  • Generate Test Data
  • More Online Tools

go - Upsert

This example shows an upsert of a document and then a retrieval of a portion of that document via the subdocument API.

Visit the docs to learn more about Key Value Operations in Go.
Also try Couchbase Server in an online playground: Start Playground Session