{"id":3973,"date":"2017-09-12T07:00:14","date_gmt":"2017-09-12T14:00:14","guid":{"rendered":"http:\/\/www.couchbase.com\/blog\/?p=3973"},"modified":"2017-08-29T14:28:28","modified_gmt":"2017-08-29T21:28:28","slug":"asynchronously-perform-subdocument-mutations-couchbase-with-golang","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/","title":{"rendered":"Executar de forma ass\u00edncrona muta\u00e7\u00f5es de subdocumentos no Couchbase com a Golang"},"content":{"rendered":"<p>Not too long ago I had written about using the <a href=\"https:\/\/www.couchbase.com\/blog\/using-the-couchbase-sub-document-api-with-the-golang-sdk\/\" target=\"_blank\" rel=\"noopener\">Couchbase Server subdocument API with the Go SDK<\/a>. Doing subdocument operations is incredibly useful if you&#8217;d like to change or access a part of a potentially huge NoSQL document. Subdocument operations save network resources and are great on performance.<\/p>\n<p>A colleague of mine asked how one might do bulk subdocument mutations by key similar to how I demonstrated in my tutorial titled,\u00a0<a href=\"https:\/\/www.couchbase.com\/blog\/using-golang-to-get-multiple-couchbase-documents-by-key-in-a-single-operation\/\" target=\"_blank\" rel=\"noopener\">Using Golang to get Multiple Couchbase Documents by Key in a Single Operation<\/a>. The short answer is that you can&#8217;t with a single operation, but because Golang is so incredibly fast and awesome, you could do things in parallel and get the same results.<\/p>\n<p>We&#8217;re going to see how to asynchronously perform subdocument mutations based on a list of document ids with the Go programming language and <a href=\"https:\/\/www.couchbase.com\" target=\"_blank\" rel=\"noopener\">Couchbase<\/a>.<\/p>\n<p><!--more--><\/p>\n<p>Let&#8217;s figure out a real-world scenario that we want to accomplish. Let&#8217;s say we have a professional networking website that receives tens-of-millions of requests a second. Performance is a must so we decide we want to batch some of those requests together the best we can. Let&#8217;s say 100 people just updated their profile to include Golang as one of their skills. We want to append this as one of their list of skills.<\/p>\n<p>Going forward, we&#8217;re going to be doing everything in a\u00a0<strong>main.go<\/strong> file somewhere in our\u00a0<strong>$GOPATH<\/strong> path. Open this file and include the following:<\/p>\n<pre class=\"lang:default decode:true \">package main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"sync\"\r\n\r\n\t\"github.com\/couchbase\/gocb\"\r\n)\r\n\r\nvar waitGroup sync.WaitGroup\r\nvar data chan string\r\nvar bucket *gocb.Bucket\r\n\r\nfunc worker() {}\r\n\r\nfunc main() {\r\n\tfmt.Println(\"Starting the application...\")\r\n\r\n\tdocumentIds := []string{\"nraboy\", \"jmichaels\", \"tgreenstein\"}\r\n\r\n\tcluster, _ := gocb.Connect(\"couchbase:\/\/localhost\")\r\n\tbucket, _ = cluster.OpenBucket(\"default\", \"\")\r\n\r\n\tfmt.Println(\"The application has completed!\")\r\n}<\/pre>\n<p>Let&#8217;s break down what we have so far.<\/p>\n<p>Because we plan to do things in parallel with goroutines, we need to know when it is safe to terminate our application. The <code>WaitGroup<\/code> allows us to keep track of our asynchronous tasks and wait until they&#8217;ve all finished before continuing. Since we&#8217;re going to be processing data with goroutines, we&#8217;ll need a channel that all goroutines that use at the same time. Each of our goroutines will be an instance of the <code>worker<\/code> method.<\/p>\n<p>In the <code>main<\/code> method we are declaring all the keys that will receive the mutation. In a production scenario, the application business logic will probably aggregate this list of keys.<\/p>\n<p>We&#8217;re also establishing a connection to Couchbase.<\/p>\n<p>With the foundation in place, let&#8217;s take a further look at the <code>main<\/code> method.<\/p>\n<pre class=\"lang:default decode:true \">func main() {\r\n\tfmt.Println(\"Starting the application...\")\r\n\r\n\tdocumentIds := []string{\"nraboy\", \"jmichaels\", \"tgreenstein\"}\r\n\tdata = make(chan string)\r\n\r\n\tcluster, _ := gocb.Connect(\"couchbase:\/\/localhost\")\r\n\tbucket, _ = cluster.OpenBucket(\"default\", \"\")\r\n\r\n\tfor i := 0; i &lt; 2; i++ {\r\n\t\twaitGroup.Add(1)\r\n\t\tgo worker()\r\n\t}\r\n\r\n\tfor i := 0; i &lt; len(documentIds); i++ {\r\n\t\tdata &lt;- documentIds[i]\r\n\t}\r\n\r\n\tclose(data)\r\n\twaitGroup.Wait()\r\n\r\n\tfmt.Println(\"The application has completed!\")\r\n}<\/pre>\n<p>In Go, we can spin up a ridiculously large amount of goroutines that will run in parallel. Of course the real number you can spin up is dependant on your hardware, but for now, let&#8217;s be conservative with two. For every <code>worker<\/code> that we start, we increase the <code>WaitGroup<\/code>. As these goroutines stop, the <code>WaitGroup<\/code> will decrease which will eventually unblock the application and allow it to terminate.<\/p>\n<p>You&#8217;ll also notice that we&#8217;ve added a channel for our string data. Each of our desired document ids are added to the channel and then the channel is closed. You&#8217;ll see why we do this when we define the <code>worker<\/code> logic.<\/p>\n<pre class=\"lang:default decode:true \">func worker() {\r\n\tdefer waitGroup.Done()\r\n\r\n\tfor {\r\n\t\tid, ok := &lt;-data\r\n\t\tif !ok {\r\n\t\t\tbreak\r\n\t\t}\r\n\r\n\t\t_, err := bucket.MutateIn(id, 0, 0).ArrayAppend(\"skills\", \"Golang\", true).Execute()\r\n\t\tif err != nil {\r\n\t\t\tfmt.Printf(\"%s - %v\\n\", id, err)\r\n\t\t}\r\n\t}\r\n}<\/pre>\n<p>The above snippet is our <code>worker<\/code> method logic. When the function terminates, the <code>defer<\/code> method executes which subtracts from the <code>WaitGroup<\/code>.<\/p>\n<p>Each <code>worker<\/code> will run forever via a loop. Each loop iteration will take ids from the <code>data<\/code> channel. If we are not <code>ok<\/code>, it likely means that the channel is empty and we should end the loop. If we do get an id, plan to do a mutation on that document and append a new string in the <code>skills<\/code> path, which we assume to be an array. If the array does not exist within the document, one will be created.<\/p>\n<p>If there is an error for any reason, maybe the key doesn&#8217;t exist, print that an error happened.<\/p>\n<p>The full code to this simple demo is as follows:<\/p>\n<pre class=\"lang:default decode:true \">package main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"sync\"\r\n\r\n\t\"github.com\/couchbase\/gocb\"\r\n)\r\n\r\nvar waitGroup sync.WaitGroup\r\nvar data chan string\r\nvar bucket *gocb.Bucket\r\n\r\nfunc worker() {\r\n\tdefer waitGroup.Done()\r\n\r\n\tfor {\r\n\t\tid, ok := &lt;-data\r\n\t\tif !ok {\r\n\t\t\tbreak\r\n\t\t}\r\n\r\n\t\t_, err := bucket.MutateIn(id, 0, 0).ArrayAppend(\"skills\", \"Golang\", true).Execute()\r\n\t\tif err != nil {\r\n\t\t\tfmt.Printf(\"%s - %v\\n\", id, err)\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunc main() {\r\n\tfmt.Println(\"Starting the application...\")\r\n\r\n\tdocumentIds := []string{\"nraboy\", \"jmichaels\", \"tgreenstein\"}\r\n\tdata = make(chan string)\r\n\r\n\tcluster, _ := gocb.Connect(\"couchbase:\/\/localhost\")\r\n\tbucket, _ = cluster.OpenBucket(\"default\", \"\")\r\n\r\n\tfor i := 0; i &lt; 2; i++ {\r\n\t\twaitGroup.Add(1)\r\n\t\tgo worker()\r\n\t}\r\n\r\n\tfor i := 0; i &lt; len(documentIds); i++ {\r\n\t\tdata &lt;- documentIds[i]\r\n\t}\r\n\r\n\tclose(data)\r\n\twaitGroup.Wait()\r\n\r\n\tfmt.Println(\"The application has completed!\")\r\n}<\/pre>\n<p>Again, these subdocument mutations to the <code>skills<\/code> array happen in parallel through goroutines. For more information on using goroutines to do things concurrently, check out a previous tutorial I wrote on the subject titled,\u00a0<a href=\"https:\/\/www.thepolyglotdeveloper.com\/2017\/05\/concurrent-golang-applications-goroutines-channels\/\" target=\"_blank\" rel=\"noopener\">Concurrent Golang Applications with Goroutines and Channels<\/a>.<\/p>\n<h2>Conclusion<\/h2>\n<p>You just saw another demo to doing subdocument mutations with Couchbase and Golang. This time we explored doing things in parallel instead of trying to use one of the bulk operators. By doing things in parallel we get nearly the same performance as doing bulk operations on a list of keys.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Not too long ago I had written about using the Couchbase Server subdocument API with the Go SDK. Doing subdocument operations is incredibly useful if you&#8217;d like to change or access a part of a potentially huge NoSQL document. Subdocument [&hellip;]<\/p>\n","protected":false},"author":63,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1815,1816,1820],"tags":[1439,2046,1586],"ppma_author":[9032],"class_list":["post-3973","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-best-practices-and-tutorials","category-couchbase-server","category-golang","tag-asynchronous","tag-mutation","tag-subdocument"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Asynchronously Perform Subdocument Mutations in Couchbase with Golang<\/title>\n<meta name=\"description\" content=\"Learn how to perform Couchbase Server subdocument mutations in parallel using the Go programming language and Goroutines.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/pt\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Asynchronously Perform Subdocument Mutations in Couchbase with Golang\" \/>\n<meta property=\"og:description\" content=\"Learn how to perform Couchbase Server subdocument mutations in parallel using the Go programming language and Goroutines.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/thepolyglotdeveloper\" \/>\n<meta property=\"article:published_time\" content=\"2017-09-12T14:00:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nraboy\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/\"},\"author\":{\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/bb545ebe83bb2d12f91095811d0a72e1\"},\"headline\":\"Asynchronously Perform Subdocument Mutations in Couchbase with Golang\",\"datePublished\":\"2017-09-12T14:00:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/\"},\"wordCount\":713,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"keywords\":[\"asynchronous\",\"mutation\",\"subdocument\"],\"articleSection\":[\"Best Practices and Tutorials\",\"Couchbase Server\",\"GoLang\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/\",\"name\":\"Asynchronously Perform Subdocument Mutations in Couchbase with Golang\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-09-12T14:00:14+00:00\",\"description\":\"Learn how to perform Couchbase Server subdocument mutations in parallel using the Go programming language and Goroutines.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Asynchronously Perform Subdocument Mutations in Couchbase with Golang\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/admin-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/bb545ebe83bb2d12f91095811d0a72e1\",\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g8863514d8bed0cf6080f23db40e00354\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"caption\":\"Nic Raboy, Developer Advocate, Couchbase\"},\"description\":\"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand.\",\"sameAs\":[\"https:\\\/\\\/www.thepolyglotdeveloper.com\",\"https:\\\/\\\/www.facebook.com\\\/thepolyglotdeveloper\",\"https:\\\/\\\/x.com\\\/nraboy\"],\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/pt\\\/author\\\/nic-raboy-2\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Executar de forma ass\u00edncrona muta\u00e7\u00f5es de subdocumentos no Couchbase com a Golang","description":"Saiba como executar muta\u00e7\u00f5es de subdocumentos do Couchbase Server em paralelo usando a linguagem de programa\u00e7\u00e3o Go e Goroutines.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/pt\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/","og_locale":"pt_BR","og_type":"article","og_title":"Asynchronously Perform Subdocument Mutations in Couchbase with Golang","og_description":"Learn how to perform Couchbase Server subdocument mutations in parallel using the Go programming language and Goroutines.","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/","og_site_name":"The Couchbase Blog","article_author":"https:\/\/www.facebook.com\/thepolyglotdeveloper","article_published_time":"2017-09-12T14:00:14+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"Nic Raboy, Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@nraboy","twitter_misc":{"Written by":"Nic Raboy, Developer Advocate, Couchbase","Est. reading time":"5 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/"},"author":{"name":"Nic Raboy, Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1"},"headline":"Asynchronously Perform Subdocument Mutations in Couchbase with Golang","datePublished":"2017-09-12T14:00:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/"},"wordCount":713,"commentCount":1,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["asynchronous","mutation","subdocument"],"articleSection":["Best Practices and Tutorials","Couchbase Server","GoLang"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/","url":"https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/","name":"Executar de forma ass\u00edncrona muta\u00e7\u00f5es de subdocumentos no Couchbase com a Golang","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-09-12T14:00:14+00:00","description":"Saiba como executar muta\u00e7\u00f5es de subdocumentos do Couchbase Server em paralelo usando a linguagem de programa\u00e7\u00e3o Go e Goroutines.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/asynchronously-perform-subdocument-mutations-couchbase-with-golang\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Asynchronously Perform Subdocument Mutations in Couchbase with Golang"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1","name":"Nic Raboy, defensor dos desenvolvedores, Couchbase","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g8863514d8bed0cf6080f23db40e00354","url":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","caption":"Nic Raboy, Developer Advocate, Couchbase"},"description":"Nic Raboy \u00e9 um defensor das modernas tecnologias de desenvolvimento m\u00f3vel e da Web. Ele tem experi\u00eancia em Java, JavaScript, Golang e uma variedade de estruturas, como Angular, NativeScript e Apache Cordova. Nic escreve sobre suas experi\u00eancias de desenvolvimento relacionadas a tornar o desenvolvimento m\u00f3vel e da Web mais f\u00e1cil de entender.","sameAs":["https:\/\/www.thepolyglotdeveloper.com","https:\/\/www.facebook.com\/thepolyglotdeveloper","https:\/\/x.com\/nraboy"],"url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/nic-raboy-2\/"}]}},"acf":[],"authors":[{"term_id":9032,"user_id":63,"is_guest":0,"slug":"nic-raboy-2","display_name":"Nic Raboy, Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/3973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=3973"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/3973\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=3973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=3973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=3973"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=3973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}