{"id":5569,"date":"2018-08-06T10:05:26","date_gmt":"2018-08-06T17:05:26","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=5569"},"modified":"2025-06-13T22:39:40","modified_gmt":"2025-06-14T05:39:40","slug":"eventing-notification-couchbase-functions","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/","title":{"rendered":"Eventing: Notification with Couchbase Functions"},"content":{"rendered":"<div class=\"paragraph\">\n<p>Important note: This blog post contains information about a developer preview CURL function in <a href=\"https:\/\/www.couchbase.com\/products\/eventing\/\">Eventing<\/a>. The CURL function will be changing in Couchbase Server 6.5, please see <a href=\"https:\/\/www.couchbase.com\/blog\/using-curl-eventing-service-update\/\">Using cURL with the Eventing Service: Update<\/a> for more details.<\/p>\n<p>Eventing is a new service available in Couchbase Server. The Cincinnati Reds are interested in using this feature to more quickly serve their VIP customers. A concierge is assigned to one or more VIPs. When the VIP enters the ballpark, a text message will be sent to the concierge. The concierge can then meet the VIP at their seats.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>As a proof of concept, I\u2019ve created an example that uses Functions (part of Eventing) to send a text message. I\u2019m using a <a href=\"https:\/\/www.twilio.com\/try-twilio\">trial account of Twilio<\/a> to send the messages. I <em>don\u2019t<\/em> know if the Reds plan to use Twilio or text messages in their production system. But it\u2019s free and easy to get started using Twilio, so that\u2019s what I decided to use in my proof of concept. You can use any messaging\/notification service you\u2019d like (instead) as long as it has an HTTP API.<\/p>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_eventing_review\">Eventing review<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>I\u2019m not going to provide all the details for eventing here. This has been blogged about plenty already by my colleagues. Definitely check out their posts for more details:<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/eventing\/\">Introducing Couchbase Eventing Service<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/using-the-curl-function-with-the-couchbase-eventing-service\/\">Using the cURL Function with the Couchbase Eventing Service<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/detect-sensitive-information-nosql-documents-automatically-couchbase-functions\/\">Detect Sensitive Information In Your NoSQL Documents Automatically With Couchbase Functions<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/couchbase-data-platform-action-setup-steps\/\">The Couchbase Data Platform in Action: Step-by-Step Setup<\/a><\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>But the short story is this: Couchbase Functions (part of Eventing) allow you to write JavaScript functions that respond to documents getting created\/updated\/deleted. Inside of these functions, you can read documents, write documents (to other buckets), execute N1QL queries, and execute a <code>curl<\/code> function to make requests to HTTP endpoints. <strong>Note: The curl construct is still in Development. This feature is intended for Development purposes only and should not be used in Production environments.<\/strong><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>I\u2019m going to put together pieces of the above blog posts to create this eventing proof of concept for the Reds.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_scanning_tickets\">Scanning Tickets<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The first step is to scan a customer\u2019s ticket at the gate. I wrote a program to <em>simulate<\/em> this. It will create a randomish &#8220;ticketscan&#8221; document in a &#8220;tickets&#8221; bucket on Couchbase.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Before scanning tickets, I needed to prepopulate the bucket with some data.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>I\u2019ve decided that customers 1 through 9 are the VIPs, and any other customer is a &#8220;regular joe&#8221;.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">_bucket.Upsert(\"customer::1\", new { Name = \"George Clooney\" });\r\n_bucket.Upsert(\"customer::2\", new { Name = \"Josh Hutcherson\" });\r\n_bucket.Upsert(\"customer::3\", new { Name = \"Darius Rucker\" });\r\n_bucket.Upsert(\"customer::4\", new { Name = \"Brooklyn Decker\" });\r\n_bucket.Upsert(\"customer::5\", new { Name = \"Eddie Vedder\" });\r\n_bucket.Upsert(\"customer::6\", new { Name = \"Nick Lachey\" });\r\n_bucket.Upsert(\"customer::7\", new { Name = \"Nick Goepper\" });\r\n_bucket.Upsert(\"customer::8\", new { Name = \"Johnny Bench\" });\r\n_bucket.Upsert(\"customer::9\", new { Name = \"Ryan Collins\" });<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><em>Fun Note: these VIPs are all actual Reds fans!<\/em><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>I also created 3 concierges and divided up the VIPs amongst them.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">_bucket.Upsert(\"concierge::1\", new\r\n{\r\n    Name = \"Matt Groves\",\r\n    CellNumber = _yourVerifiedNumber,\r\n    vips = new List&lt;string&gt; { \"customer::1\", \"customer::2\", \"customer::9\" }\r\n});\r\n_bucket.Upsert(\"concierge::2\", new\r\n{\r\n    Name = \"Mr. Redlegs\",\r\n    CellNumber = _yourVerifiedNumber,\r\n    vips = new List&lt;string&gt; { \"customer::3\", \"customer::4\", \"customer::5\" }\r\n});\r\n_bucket.Upsert(\"concierge::3\", new\r\n{\r\n    Name = \"Rosie Red\",\r\n    CellNumber = _yourVerifiedNumber,\r\n    vips = new List&lt;string&gt; { \"customer::6\", \"customer::7\", \"customer::8\" }\r\n});<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>In the above example, I\u2019m assigning customers 1, 2, and 9 to &#8220;Matt Groves&#8221;. This means that George Clooney, Josh Hutcherson, and Ryan Collins are the VIPs that concierge Matt Groves is assigned to take care of. (Replace <code>_yourVerifiedNumber<\/code> with the phone number that you\u2019ve confirmed with Twilio).<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>I\u2019m also storing Twilio credentials in a document. I did this because I\u2019ll need the credentials inside of a Couchbase Function, and I didn\u2019t want to hard-code them there. The credential document looks like:<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-JavaScript\">{\r\n  \"url\": \"https:\/\/api.twilio.com\/2010-04-01\/Accounts\/&lt; twilio user name here &gt;\/Messages.json\",\r\n  \"username\": \"&lt; twilio user name here &gt;\",\r\n  \"password\": \"&lt; twilio password name here &gt;\",\r\n  \"fromNumber\": \"&lt; twilio 'from' number here &gt;\"\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>I\u2019ve created a console app that will create a new &#8220;ticketscan&#8221; document. When you run it, you can choose to create a VIP scan or a &#8220;regular Joe&#8221; scan.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">Console.WriteLine(\"1 - Simulate a VIP ticket scan.\");\r\nConsole.WriteLine(\"2 - Simulate a regular joe ticket scan.\");\r\nConsole.WriteLine(\"Q - End simulation.\");\r\nvar choice = Console.ReadKey().KeyChar;<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>A ticketscan document contains only three fields: the ID of the customer document, a timestamp, and a seat number.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">_bucket.Upsert(ticketScanId, new {CustomerId = customerId, Timestamp = ticketScanTimestamp, Seat = seatInformation });<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>You can find the <a href=\"https:\/\/github.com\/couchbaselabs\/blog-source-code\/tree\/master\/Groves\/111RedsEventingTwilio\/src\/TicketVip\">full source code on Github<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_eventing_function\">Eventing function<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The core of this eventing example is the function. When I created this function, I called it &#8220;notifyConcierge&#8221;; I used a &#8220;tickets_metadata&#8221; bucket (as pictured below). Most importantly, I created an alias for the &#8220;tickets&#8221; bucket and called it &#8220;src&#8221;. Within the function, this bucket is read-only, but I need it to get customer and concierge information as well as the Twilio credentials.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/08\/11101-create-eventing-function.png\" alt=\"Creating a function in eventing\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>The <a href=\"https:\/\/github.com\/couchbaselabs\/blog-source-code\/blob\/master\/Groves\/111RedsEventingTwilio\/src\/TicketVip\/TicketVip\/notifyConcierge.js\">entire function can be viewed on Github<\/a>. Here is the breakdown of the function, step by step:<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>1 &#8211; Is the mutated document a ticketscan? If it is, proceed. If not, this function can ignore it.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">if (meta.id.indexOf(\"ticketscan::\") !== -1) {<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>2 &#8211; Is the customer who scanned this ticket a VIP? If so, get the concierge\u2019s details and proceed. Otherwise, ignore it. Notice the inline N1QL in this part of the function. This is a feature unique to the flavor of JavaScript used in Couchbase functions.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">let customerId = doc.customerId;\r\nlet stmt = SELECT t.cellNumber, t.name\r\n           FROM tickets t\r\n           WHERE ANY v IN t.vips SATISFIES v == $customerId END;\r\n\r\n\/\/get the concierge (there should only be one)\r\nlet concierge = null;\r\nfor (var record of stmt) {\r\n    concierge = record;\r\n}\r\n\r\n\/\/ only proceed with notification if\r\n\/\/ the customer has a concierge\r\nif (concierge) {<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>3 &#8211; Get the details of the VIP.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">let customer = src[customerId];<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>4 &#8211; Get Twilio credentials.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">let twilioCredentials = src[\"twilio::credentials\"];<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>5 &#8211; Construct a message (containing VIP\u2019s name, seat number, and concierge\u2019s name). <code>data<\/code> is the minimum needed to use Twilio\u2019s API.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">let message = \"Hello '\" + concierge.name + \"'. A VIP assigned to you just checked in. '\" + customer.name + \"' will be in '\" + doc.seat + \"'\";\r\nlet from = twilioCredentials.fromNumber;\r\nlet data = \"To=\" + concierge.cellNumber + \"&amp;From=\" + from + \"&amp;Body=\" + message;<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>6 &#8211; Send a text message to the concierge using Twilio API. <strong>The curl construct is still in Development. This feature is intended for Development purposes only and should not be used in Production environments.<\/strong><\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">let url = twilioCredentials.url;\r\nlet auth = twilioCredentials.username + \": \" + twilioCredentials.password;\r\nvar result = curl(url, { \"data\": data, \"header\": [\"Content-Type: x-www-form-urlencoded\"], \"method\": \"POST\", \"auth\": auth });<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_eventing_in_action\">Eventing in action<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Now, whenever a ticketscan document is created or modified, a concierge will be notified on their cell phone. Here\u2019s an example of the entire demo, from ticket scan to SMS notification:<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/08\/11102-function-sending-text-message.gif\" alt=\"Eventing demonstration using SMS\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>In this image, I\u2019m creating 4 ticket scans. The first is for a VIP, the next two are for regular Joes, and the last is for a VIP. Two text messages appear. In reality, these would appear on different phones, but I\u2019m sending all the notifications to a single number for testing. <em>Note: I\u2019m using <a href=\"https:\/\/www.join.me\/\">join.me<\/a> to show my live Android screen side-by-side with the console).<\/em><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>If you\u2019re running into any issues, the good news is that debugging is available for Functions in Couchbase. You can set breakpoints in the JavaScript and step through it using a tool like Chrome. For more about it, check out the <a href=\"https:\/\/www.couchbase.com\/blog\/eventing\/\">Eventing announcement post<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_summary\">Summary<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>With this function running in Couchbase\u2019s eventing system, every new ticketscan for a VIP will trigger a text message notification. Note that the ticket scanning system doesn\u2019t need to know anything about Twilio, as long as the data ends up in Couchbase. Also, if <em>any other<\/em> system is creating ticketscan documents, the SMS will be triggered there as well. The logic is <em>close<\/em> to the data.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>This wraps up my series of Cincinnati Reds posts (for now). The other two posts in the series were:<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/nifi-processing-flow-couchbase-server\/\">Nifi Processing and Flow with Couchbase Server<\/a> &#8211; This is how the Reds are actually going to put ticket scan data into Couchbase.<\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/data-visualization-couchbase-knowi\/\">Data Visualization with Couchbase and Knowi<\/a> &#8211; This is another use case that the Reds are looking at using ticket scan data for.<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>Please leave a comment below or find me on <a href=\"https:\/\/twitter.com\/mgroves\">Twitter @mgroves<\/a>. Go Reds!<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Important note: This blog post contains information about a developer preview CURL function in Eventing. The CURL function will be changing in Couchbase Server 6.5, please see Using cURL with the Eventing Service: Update for more details. Eventing is a [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":5570,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1811,1816,2273],"tags":[2258,2133],"ppma_author":[8937],"class_list":["post-5569","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-couchbase-server","category-eventing","tag-5-5","tag-functions"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Eventing: Notification with Couchbase Functions - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"Eventing is a new service available in Couchbase Server. The Cincinnati Reds are interested in using this feature to more quickly serve their VIP customers.\" \/>\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\/eventing-notification-couchbase-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Eventing: Notification with Couchbase Functions\" \/>\n<meta property=\"og:description\" content=\"Eventing is a new service available in Couchbase Server. The Cincinnati Reds are interested in using this feature to more quickly serve their VIP customers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-06T17:05:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T05:39:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/08\/111-hero-cincinnati-reds-vip.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2048\" \/>\n\t<meta property=\"og:image:height\" content=\"1463\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Matthew Groves\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mgroves\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matthew Groves\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/\"},\"author\":{\"name\":\"Matthew Groves\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58\"},\"headline\":\"Eventing: Notification with Couchbase Functions\",\"datePublished\":\"2018-08-06T17:05:26+00:00\",\"dateModified\":\"2025-06-14T05:39:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/\"},\"wordCount\":1094,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/08\/111-hero-cincinnati-reds-vip.jpg\",\"keywords\":[\"5.5\",\"functions\"],\"articleSection\":[\".NET\",\"Couchbase Server\",\"Eventing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/\",\"name\":\"Eventing: Notification with Couchbase Functions - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/08\/111-hero-cincinnati-reds-vip.jpg\",\"datePublished\":\"2018-08-06T17:05:26+00:00\",\"dateModified\":\"2025-06-14T05:39:40+00:00\",\"description\":\"Eventing is a new service available in Couchbase Server. The Cincinnati Reds are interested in using this feature to more quickly serve their VIP customers.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/08\/111-hero-cincinnati-reds-vip.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/08\/111-hero-cincinnati-reds-vip.jpg\",\"width\":2048,\"height\":1463,\"caption\":\"From https:\/\/www.nationalmuseum.af.mil\/Upcoming\/Photos\/igphoto\/2001339275\/mediaid\/2438863\/\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Eventing: Notification with Couchbase Functions\"}]},{\"@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\/3929663e372020321b0152dc4fa65a58\",\"name\":\"Matthew Groves\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ba51e6aacc53995c323a634e4502ef54\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g\",\"caption\":\"Matthew Groves\"},\"description\":\"Matthew D. Groves is a guy who loves to code. It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything. He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s. He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community. He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP.\",\"sameAs\":[\"https:\/\/crosscuttingconcerns.com\",\"https:\/\/x.com\/mgroves\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/matthew-groves\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Eventing: Notification with Couchbase Functions - The Couchbase Blog","description":"Eventing is a new service available in Couchbase Server. The Cincinnati Reds are interested in using this feature to more quickly serve their VIP customers.","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\/eventing-notification-couchbase-functions\/","og_locale":"en_US","og_type":"article","og_title":"Eventing: Notification with Couchbase Functions","og_description":"Eventing is a new service available in Couchbase Server. The Cincinnati Reds are interested in using this feature to more quickly serve their VIP customers.","og_url":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/","og_site_name":"The Couchbase Blog","article_published_time":"2018-08-06T17:05:26+00:00","article_modified_time":"2025-06-14T05:39:40+00:00","og_image":[{"width":2048,"height":1463,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/08\/111-hero-cincinnati-reds-vip.jpg","type":"image\/jpeg"}],"author":"Matthew Groves","twitter_card":"summary_large_image","twitter_creator":"@mgroves","twitter_misc":{"Written by":"Matthew Groves","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/"},"author":{"name":"Matthew Groves","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58"},"headline":"Eventing: Notification with Couchbase Functions","datePublished":"2018-08-06T17:05:26+00:00","dateModified":"2025-06-14T05:39:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/"},"wordCount":1094,"commentCount":3,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/08\/111-hero-cincinnati-reds-vip.jpg","keywords":["5.5","functions"],"articleSection":[".NET","Couchbase Server","Eventing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/","url":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/","name":"Eventing: Notification with Couchbase Functions - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/08\/111-hero-cincinnati-reds-vip.jpg","datePublished":"2018-08-06T17:05:26+00:00","dateModified":"2025-06-14T05:39:40+00:00","description":"Eventing is a new service available in Couchbase Server. The Cincinnati Reds are interested in using this feature to more quickly serve their VIP customers.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/08\/111-hero-cincinnati-reds-vip.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/08\/111-hero-cincinnati-reds-vip.jpg","width":2048,"height":1463,"caption":"From https:\/\/www.nationalmuseum.af.mil\/Upcoming\/Photos\/igphoto\/2001339275\/mediaid\/2438863\/"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/eventing-notification-couchbase-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Eventing: Notification with Couchbase Functions"}]},{"@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\/3929663e372020321b0152dc4fa65a58","name":"Matthew Groves","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ba51e6aacc53995c323a634e4502ef54","url":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","caption":"Matthew Groves"},"description":"Matthew D. Groves is a guy who loves to code. It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything. He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s. He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community. He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP.","sameAs":["https:\/\/crosscuttingconcerns.com","https:\/\/x.com\/mgroves"],"url":"https:\/\/www.couchbase.com\/blog\/author\/matthew-groves\/"}]}},"authors":[{"term_id":8937,"user_id":71,"is_guest":0,"slug":"matthew-groves","display_name":"Matthew Groves","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","author_category":"","last_name":"Groves","first_name":"Matthew","job_title":"","user_url":"https:\/\/crosscuttingconcerns.com","description":"Matthew D. Groves is a guy who loves to code.  It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything.  He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s.  He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community.  He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/5569","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\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=5569"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/5569\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/5570"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=5569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=5569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=5569"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=5569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}