{"id":2524,"date":"2017-02-07T00:50:10","date_gmt":"2017-02-07T00:50:09","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2524"},"modified":"2025-06-13T19:58:43","modified_gmt":"2025-06-14T02:58:43","slug":"getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/","title":{"rendered":"Getting Comfortable with Couchbase Mobile: Sync Gateway via the Command Line"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>This continues my my &#8220;Getting Comfortable with Couchbase Mobile&#8221; series (post #5). This time we&#8217;ll look at exploring <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/current\/guides\/sync-gateway\/index.html?utm_source=blogs&amp;utm_medium=link&amp;utm_campaign=blogs\">Sync Gateway<\/a> from the command line. This can be really helpful, both for understanding and for testing\/debugging. \u00a0(Links to other posts in the series provided at the end.)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2554 size-large\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/02\/couchbase-mobile-stack_1920-1024x331.png\" alt=\"Couchbase Mobile Stack\" width=\"900\" height=\"291\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920-1024x331.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920-300x97.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920-768x248.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920-1536x497.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920-20x6.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920-1320x427.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920.png 1920w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h2>Background<\/h2>\n<p>To get comfortable with the whole <a href=\"https:\/\/www.couchbase.com\/developers\/mobile\/?utm_source=blogs&amp;utm_medium=link&amp;utm_campaign=blogs\">Couchbase Mobile<\/a> stack, it&#8217;s great to install and run everything on one machine. In this series of posts, I&#8217;ll walk through the steps get to started with each component. I&#8217;ll show how to do a little extra exploring along the way, too.<\/p>\n<p>I&#8217;ll only do minimal configuration. This is not intended to explain what you need for a production environment. I assume you&#8217;re familiar with some basics of NoSQL, have some understanding of Couchbase, and know how to build apps in something like Java, Android, or iOS. If you want to read up on NoSQL databases or Couchbase, you can find lots of resources on the <a href=\"https:\/\/www.couchbase.com\/?utm_source=blogs&amp;utm_medium=link&amp;utm_campaign=blogs\">Couchbase<\/a> site.<\/p>\n<p>Couchbase is open-source. Everything I&#8217;ll use here is free to try out. See the end of the post for more resources if you need help.<\/p>\n<h2>Sync Gateway<\/h2>\n<p>Sync Gateway is a secure web gateway application with synchronization, REST, stream, batch and event APIs for accessing and synchronizing data over the web. Sync Gateway enables, among other things, secure data replication between Couchbase Server and Couchbase Lite.<\/p>\n<p>Sync Gateway has few dependencies, and can run on most Linux distributions (even on the Raspberry Pi), Windows, and OSX\/macOS. The specific steps for installation vary with platform. See the <a href=\"https:\/\/www.couchbase.com\/developers\/mobile\/?language=ios\">downloads<\/a> site for all the available packages. To install on Linux distributions other than the supported ones, see <a href=\"https:\/\/www.couchbase.com\/blog\/installing-sync-gateway-alternate-linux-distributions\/\">this post<\/a>.<\/p>\n<h2>Configuration and running<\/h2>\n<p>Once you have Sync Gateway installed, open up a command line shell.<\/p>\n<p>Next, I have two configurations listed. You can either find these in the <code>examples<\/code> folder of your installation, or copy and paste the text here into your own.<\/p>\n<p>The first you can use if you have <a href=\"https:\/\/www.couchbase.com\/products\/server\/\">Couchbase Server<\/a> running on your machine. This is the configuration you&#8217;ll find in <code>examples\/basic-couchbase-bucket.json<\/code>.<\/p>\n<pre><code class=\"language-json\">{\r\n  \"log\": [\"*\"],\r\n  \"databases\": {\r\n    \"db\": {\r\n      \"server\": \"https:\/\/localhost:8091\",\r\n      \"bucket\": \"default\",\r\n      \"users\": { \"GUEST\": { \"disabled\": false, \"admin_channels\": [\"*\"] } }\r\n    }\r\n  }\r\n}<\/code><\/pre>\n<p>Or to just use Sync Gateway stand-alone (usually for testing only), use this configuration (found in <code>examples\/basic-walrus-bucket.json<\/code>):<\/p>\n<pre><code class=\"language-json\">{\r\n  \"log\": [\"*\"],\r\n  \"databases\": {\r\n    \"db\": {\r\n      \"server\": \"walrus:\",\r\n      \"users\": { \"GUEST\": { \"disabled\": false, \"admin_channels\": [\"*\"] } },\r\n      \"allow_empty_password\": true\r\n    }\r\n  }\r\n}<\/code><\/pre>\n<h2>Creating a document<\/h2>\n<p>From the command line, run Sync Gateway and supply the path to the configuration file.<\/p>\n<pre><code class=\"language-bash\">$ \/path\/to\/sync_gateway your_config.json<\/code><\/pre>\n<p>At this point the special GUEST user is enabled. We can go ahead and create a document.<\/p>\n<pre><code class=\"language-bash\">$ curl -s -g -X PUT -H 'Content-Type: application\/json' -d '{ \"test\": \"entry\" }' localhost:4984\/db\/a_doc<\/code><\/pre>\n<p>The response shows the write succeeded. You can also see this in the Sync Gateway log output, and by looking at the backing bucket in the <a href=\"https:\/\/www.couchbase.com\/blog\/comfortable-couchbase-mobile-couchbase-web-console\/\">Couchbase Server Web Console<\/a>.<\/p>\n<p>Here&#8217;s the response we see on the command line.<\/p>\n<pre><code class=\"language-json\">{\"id\":\"a_doc\",\"ok\":true,\"rev\":\"1-93996db139ad4024d0c7c982d4f69122\"}<\/code><\/pre>\n<h2>Updating a document<\/h2>\n<p>Next, let&#8217;s try to make a change in the document.<\/p>\n<pre><code class=\"language-bash\">$ curl -s -g -X PUT -H 'Content-Type: application\/json' -d '{ \"test\": \"changed\" }' localhost:4984\/db\/a_doc<\/code><\/pre>\n<p>The output shows this failed.<\/p>\n<pre><code class=\"language-json\">{\"error\":\"conflict\",\"reason\":\"Document exists\"}<\/code><\/pre>\n<p>Why? If you recall from other parts of this blog series, Couchbase Mobile uses something called Multiversion Concurrency Control to track revisions. That means when we make changes to a document, we have to indicate what the &#8220;parent&#8221; document is.<\/p>\n<p>Let&#8217;s try again, this time specifying the parent revision.<\/p>\n<pre><code class=\"language-bash\">$ curl -s -g -X PUT -H 'Content-Type: application\/json' -d '{ \"test\": \"changed\" }' 'localhost:4984\/db\/a_doc?rev=1-93996db139ad4024d0c7c982d4f69122'<\/code><\/pre>\n<p>That works. The response is<\/p>\n<pre><code class=\"language-json\">{\"id\":\"a_doc\",\"ok\":true,\"rev\":\"2-8d7051e4510c47c5e0aa74aed1fbd788\"}<\/code><\/pre>\n<h2>Monitoring the changes feed<\/h2>\n<p>The changes feed gives you a great way to track the database. You can use this to write event-driven server side logic, or implement an automated conflict resolution system.<\/p>\n<p>We&#8217;ll show a version that keeps the feed open. You might want to open another command line window to watch the output.<\/p>\n<pre class=\"lang:zsh decode:true \">$ curl -X GET 'localhost:4984\/db\/_changes?feed=continuous&amp;heartbeat=26000&amp;since=0'\r\n<\/pre>\n<p>Here we&#8217;ve set the feed type to continuous. Various elements along a network path may close a connection that appears idle. Sync Gateway can send a heartbeat to prevent that. We set a timeout of 26000 milliseconds.<\/p>\n<p>The last parameter, <code>since<\/code>, tells Sync Gateway where we want to start in the overall sequence of changes. You should normally treat this as an opaque value. Typically an app will start without specifying this parameter (getting all changes), then track the value sent back to use in future requests.<\/p>\n<p>Here&#8217;s what a set of changes looks like.<\/p>\n<pre><code class=\"language-json\">{\"seq\":1,\"id\":\"_user\/\",\"changes\":[{\"rev\":\"\"}]}\r\n{\"seq\":3,\"id\":\"a_doc\",\"changes\":[{\"rev\":\"2-8d7051e4510c47c5e0aa74aed1fbd788\"}]}<\/code><\/pre>\n<h2>Adding a user<\/h2>\n<p>Now, let&#8217;s add a new user, <code>jdoe<\/code>. This is an admin function, so the request has to go through the admin port. (Port 4985 if you&#8217;re using one of the listed configurations.)<\/p>\n<pre><code class=\"language-bash\">$ curl -s -g -X PUT -H 'Content-Type: application\/json' -d '{ \"password\": \"pass\", \"admin_channels\": [ \"ch9\" ] }' localhost:4985\/db\/_user\/jdoe<\/code><\/pre>\n<p>We&#8217;ll also disable anonymous (GUEST) access.<\/p>\n<pre><code class=\"language-bash\">$ curl -s -g -X PUT -H 'Content-Type: application\/json' -d '{ \"disabled\": true }' localhost:4985\/db\/_user\/GUEST<\/code><\/pre>\n<p>We can no longer access Sync Gateway from the public port (4984) without supplying a username and password.<\/p>\n<h2>Channels<\/h2>\n<p>Let&#8217;s add a doc with a special field, <code>channels<\/code>.<\/p>\n<pre><code class=\"language-bash\">$ curl -s -g -u 'jdoe:pass' -X PUT -H 'Content-Type: application\/json' -d '{ \"my\": \"doc\", \"channels\":\"abc\" }' localhost:4984\/db\/jd_doc<\/code><\/pre>\n<p>You should see this returned.<\/p>\n<pre><code class=\"language-json\">{\"id\":\"jd_doc\",\"ok\":true,\"rev\":\"1-4407b06b44eccdf1a9ef8cbe6f5dbe7f\"}<\/code><\/pre>\n<p>Sync Gateway passes every document through a special function, called the sync function, whenever a document gets updated. We didn&#8217;t specify a sync function, so the default is automatically used.<\/p>\n<p>The default function looks for <code>channels<\/code> in the document properties. If found, the document is assigned to that channel.<\/p>\n<p>A user must have access to a channel to receive a document assigned to that channel. You can read more about channels <a href=\"https:\/\/developer.couchbase.com\/documentation\/mobile\/current\/guides\/sync-gateway\/sync-function-api-guide\/index.html?utm_source=blogs&amp;utm_medium=link&amp;utm_campaign=blogs\">here<\/a>. We&#8217;ll see the impact coming up.<\/p>\n<p>Just to see what happens when we don&#8217;t authenticate, try this command. The request gets rejected<\/p>\n<pre><code class=\"language-bash\">$ curl -X GET localhost:4984\/db\/jd_doc<\/code><\/pre>\n<p>with the expected response.<\/p>\n<pre><code class=\"language-json\">{\"error\":\"Unauthorized\",\"reason\":\"Login required\"}<\/code><\/pre>\n<p>How about if we try again, supplying the right username and password?<\/p>\n<pre><code class=\"language-bash\">$ curl -u 'jdoe:pass' -X GET localhost:4984\/db\/jd_doc<\/code><\/pre>\n<p>This sometimes catches people by surprise. We get rejected again, but for a different reason.<\/p>\n<pre><code class=\"language-json\">{\"error\":\"Forbidden\",\"reason\":\"forbidden\"}<\/code><\/pre>\n<p>What happened? Remember when we wrote the doc, we assigned it to channel <code>abc<\/code>. Even though user <code>jdoe<\/code> wrote the doc, we haven&#8217;t given access to the <code>abc<\/code> channel. Without that, <code>jdoe<\/code> isn&#8217;t allowed to read the doc back.<\/p>\n<p>Change the channels <code>jdoe<\/code> has access to<\/p>\n<pre><code class=\"language-bash\">$ curl -s -g -X PUT -H 'Content-Type: application\/json' -d '{ \"admin_channels\": [ \"abc\" ] }' localhost:4985\/db\/_user\/jdoe<\/code><\/pre>\n<p>and see that the user can now access the doc.<\/p>\n<pre><code class=\"language-bash\">$ curl -u 'jdoe:pass' -X GET localhost:4984\/db\/jd_doc<\/code><\/pre>\n<p>Success!<\/p>\n<pre><code class=\"language-json\">{\"_id\":\"jd_doc\",\"_rev\":\"1-4407b06b44eccdf1a9ef8cbe6f5dbe7f\",\"channels\":\"abc\",\"my\":\"doc\"}<\/code><\/pre>\n<h2>Wrapping up<\/h2>\n<p>Hopefully that gives some insight into Sync Gateway. I encourage you to check out the <a href=\"https:\/\/www.couchbase.com\/developers\/mobile\/?utm_source=blogs&amp;utm_medium=link&amp;utm_campaign=blogs\">REST API<\/a> further. You can find more interesting information looking at the Sync Gateway built-in web admin utility (https:\/\/localhost:4985\/_admin\/) and the Couchbase Server Web Console.<\/p>\n<p>For an interesting example of using Sync Gateway stand-alone, see our talk from CouchBase Connect 2016: <a href=\"https:\/\/www.youtube.com\/watch?v=6Ra4NeY7TNA\">https:\/\/www.youtube.com\/watch?v=6Ra4NeY7TNA<\/a><\/p>\n<p>[buttongroup][button style=&#8221;btn-link btn-lg&#8221; icon=&#8221;fa fa-arrow-left&#8221; align=&#8221;left&#8221; iconcolor=&#8221;#dd3333&#8243; type=&#8221;link&#8221; target=&#8221;false&#8221; title=&#8221;Previous: Installing Sync Gateway&#8221; link=&#8221;https:\/\/www.couchbase.com\/blog\/getting-comfortable-couchbase-mobile-installing-sync-gateway\/&#8221; linkrel=&#8221;&#8221;][button style=&#8221;btn-link btn-lg&#8221; icon=&#8221;fa fa-arrow-right&#8221; align=&#8221;left&#8221; iconcolor=&#8221;#dd3333&#8243; type=&#8221;link&#8221; target=&#8221;false&#8221; title=&#8221;Next: TBD&#8221; link=&#8221;&#8221; linkrel=&#8221;&#8221;][\/buttongroup]<\/p>\n<h2>Postscript<\/h2>\n<p>Check out more resources on our <a href=\"https:\/\/www.couchbase.com\/developers\/community?utm_source=blogs&amp;utm_medium=link&amp;utm_campaign=blogs\">developer portal<\/a> and follow us on Twitter <a href=\"https:\/\/twitter.com\/CouchbaseDev\">@CouchbaseDev<\/a>.<\/p>\n<p>You can post questions on our <a href=\"https:\/\/www.couchbase.com\/forums\/?utm_source=blogs&amp;utm_medium=link&amp;utm_campaign=blogs\">forums<\/a>. And we actively participate on <a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/couchbase\">Stack Overflow<\/a>.<\/p>\n<p>You can follow me personally at <a href=\"https:\/\/twitter.com\/HodGreeley\">@HodGreeley<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction This continues my my &#8220;Getting Comfortable with Couchbase Mobile&#8221; series (post #5). This time we&#8217;ll look at exploring Sync Gateway from the command line. This can be really helpful, both for understanding and for testing\/debugging. \u00a0(Links to other posts [&hellip;]<\/p>\n","protected":false},"author":73,"featured_media":2554,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1810,2366],"tags":[],"ppma_author":[9042],"class_list":["post-2524","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-mobile","category-sync-gateway"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Sync Gateway via the Command Line - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"Explore more about the post &quot;Sync Gateway from the command line&quot;. This can be really helpful, both for understanding and for testing\/debugging.\" \/>\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\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting Comfortable with Couchbase Mobile: Sync Gateway via the Command Line\" \/>\n<meta property=\"og:description\" content=\"Explore more about the post &quot;Sync Gateway from the command line&quot;. This can be really helpful, both for understanding and for testing\/debugging.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-07T00:50:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T02:58:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"621\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Hod Greeley, Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@HodGreeley\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hod Greeley, Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/\"},\"author\":{\"name\":\"Hod Greeley, Developer Advocate, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/9b62593c8a13531e53d52fcd5aabbca4\"},\"headline\":\"Getting Comfortable with Couchbase Mobile: Sync Gateway via the Command Line\",\"datePublished\":\"2017-02-07T00:50:09+00:00\",\"dateModified\":\"2025-06-14T02:58:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/\"},\"wordCount\":1086,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920.png\",\"articleSection\":[\"Couchbase Mobile\",\"Sync Gateway\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/\",\"name\":\"Sync Gateway via the Command Line - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920.png\",\"datePublished\":\"2017-02-07T00:50:09+00:00\",\"dateModified\":\"2025-06-14T02:58:43+00:00\",\"description\":\"Explore more about the post \\\"Sync Gateway from the command line\\\". This can be really helpful, both for understanding and for testing\/debugging.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920.png\",\"width\":1920,\"height\":621,\"caption\":\"Couchbase Mobile Stack\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting Comfortable with Couchbase Mobile: Sync Gateway via the Command Line\"}]},{\"@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\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@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\/9b62593c8a13531e53d52fcd5aabbca4\",\"name\":\"Hod Greeley, Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/21eb69cb5d4a401fb23b149e4f4e9e87\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/52d0018695c0ced0d1c68cf64a6195c81dbac03dce5983f98eb209e7c84350df?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/52d0018695c0ced0d1c68cf64a6195c81dbac03dce5983f98eb209e7c84350df?s=96&d=mm&r=g\",\"caption\":\"Hod Greeley, Developer Advocate, Couchbase\"},\"description\":\"Hod Greeley is a Developer Advocate for Couchbase, living in Silicon Valley. He has over two decades of experience as a software engineer and engineering manager. He has worked in a variety of software fields, including computational physics and chemistry, computer and network security, finance, and mobile. Prior to joining Couchbase in 2016, Hod led developer relations for mobile at Samsung. Hod holds a Ph.D. in chemical physics from Columbia University.\",\"sameAs\":[\"https:\/\/hod.greeley.org\/blog\",\"https:\/\/x.com\/HodGreeley\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/hod-greeley\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Sync Gateway via the Command Line - The Couchbase Blog","description":"Explore more about the post \"Sync Gateway from the command line\". This can be really helpful, both for understanding and for testing\/debugging.","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\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/","og_locale":"en_US","og_type":"article","og_title":"Getting Comfortable with Couchbase Mobile: Sync Gateway via the Command Line","og_description":"Explore more about the post \"Sync Gateway from the command line\". This can be really helpful, both for understanding and for testing\/debugging.","og_url":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-02-07T00:50:09+00:00","article_modified_time":"2025-06-14T02:58:43+00:00","og_image":[{"width":1920,"height":621,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920.png","type":"image\/png"}],"author":"Hod Greeley, Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@HodGreeley","twitter_misc":{"Written by":"Hod Greeley, Developer Advocate, Couchbase","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/"},"author":{"name":"Hod Greeley, Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/9b62593c8a13531e53d52fcd5aabbca4"},"headline":"Getting Comfortable with Couchbase Mobile: Sync Gateway via the Command Line","datePublished":"2017-02-07T00:50:09+00:00","dateModified":"2025-06-14T02:58:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/"},"wordCount":1086,"commentCount":2,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920.png","articleSection":["Couchbase Mobile","Sync Gateway"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/","url":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/","name":"Sync Gateway via the Command Line - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920.png","datePublished":"2017-02-07T00:50:09+00:00","dateModified":"2025-06-14T02:58:43+00:00","description":"Explore more about the post \"Sync Gateway from the command line\". This can be really helpful, both for understanding and for testing\/debugging.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/02\/couchbase-mobile-stack_1920.png","width":1920,"height":621,"caption":"Couchbase Mobile Stack"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/getting-comfortable-with-couchbase-mobile-sync-gateway-via-the-command-line\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Getting Comfortable with Couchbase Mobile: Sync Gateway via the Command Line"}]},{"@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":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@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\/9b62593c8a13531e53d52fcd5aabbca4","name":"Hod Greeley, Developer Advocate, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/21eb69cb5d4a401fb23b149e4f4e9e87","url":"https:\/\/secure.gravatar.com\/avatar\/52d0018695c0ced0d1c68cf64a6195c81dbac03dce5983f98eb209e7c84350df?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/52d0018695c0ced0d1c68cf64a6195c81dbac03dce5983f98eb209e7c84350df?s=96&d=mm&r=g","caption":"Hod Greeley, Developer Advocate, Couchbase"},"description":"Hod Greeley is a Developer Advocate for Couchbase, living in Silicon Valley. He has over two decades of experience as a software engineer and engineering manager. He has worked in a variety of software fields, including computational physics and chemistry, computer and network security, finance, and mobile. Prior to joining Couchbase in 2016, Hod led developer relations for mobile at Samsung. Hod holds a Ph.D. in chemical physics from Columbia University.","sameAs":["https:\/\/hod.greeley.org\/blog","https:\/\/x.com\/HodGreeley"],"url":"https:\/\/www.couchbase.com\/blog\/author\/hod-greeley\/"}]}},"authors":[{"term_id":9042,"user_id":73,"is_guest":0,"slug":"hod-greeley","display_name":"Hod Greeley, Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/52d0018695c0ced0d1c68cf64a6195c81dbac03dce5983f98eb209e7c84350df?s=96&d=mm&r=g","author_category":"","last_name":"Greeley","first_name":"Hod","job_title":"","user_url":"https:\/\/hod.greeley.org\/blog","description":"Hod Greeley is a Developer Advocate for Couchbase, living in Silicon Valley. He has over two decades of experience as a software engineer and engineering manager. He has worked in a variety of software fields, including computational physics and chemistry, computer and network security, finance, and mobile. Prior to joining Couchbase in 2016, Hod led developer relations for mobile at Samsung. Hod holds a Ph.D. in chemical physics from Columbia University."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/73"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2524"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2524\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/2554"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2524"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}