{"id":2953,"date":"2017-03-16T06:58:49","date_gmt":"2017-03-16T13:58:49","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2953"},"modified":"2023-06-19T03:19:59","modified_gmt":"2023-06-19T10:19:59","slug":"fakeit-series-shared-data-dependencies","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/","title":{"rendered":"FakeIt Series 2 of 5: Shared Data and Dependencies"},"content":{"rendered":"<p>Aaron Benton is an experienced architect who specializes in creative solutions to develop innovative mobile applications. He has over 10 years experience in full stack development, including ColdFusion, SQL, NoSQL, JavaScript, HTML, and CSS. Aaron is currently an Applications Architect for Shop.com in Greensboro, North Carolina and is a <a href=\"https:\/\/developer.couchbase.com\/experts-and-champions\">Couchbase Community Champion<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2974\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/aaronb-benton-headshot_1000x1000-300x300.jpg\" alt=\"Aaron Benton\" width=\"300\" height=\"300\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/aaronb-benton-headshot_1000x1000-300x300.jpg 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/aaronb-benton-headshot_1000x1000-150x150.jpg 150w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/aaronb-benton-headshot_1000x1000-768x768.jpg 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/aaronb-benton-headshot_1000x1000-65x65.jpg 65w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/aaronb-benton-headshot_1000x1000-50x50.jpg 50w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/aaronb-benton-headshot_1000x1000-20x20.jpg 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/aaronb-benton-headshot_1000x1000.jpg 1000w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h2><strong>FakeIt Series 2 of 5: Shared Data and Dependencies<\/strong><\/h2>\n<p>In <a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-generating-fake-data\/\">FakeIt Series 1 of 5: Generating Fake Data<\/a>\u00a0we learned that FakeIt can generate a large amount of random data based off a single YAML file and output the results to various formats and destination, including Couchbase Server. Today we are going to explore what makes FakeIt truly unique and powerful in the world of data generation.<\/p>\n<p>There are tons of random data generators available, a simple <u><a href=\"https:\/\/www.google.com\/webhp?sourceid=chrome-instant&amp;ion=1&amp;espv=2&amp;ie=UTF-8#q=random+data+generator&amp;*\" target=\"_blank\" rel=\"noopener noreferrer\">Google Search<\/a><\/u>\u00a0will give you more than enough to choose from. However, almost all of these have the same frustrating flaw, which is they can only ever deal with a single model. Rarely as developers do we have the luxury of dealing with a single model, more often than not we are developing against multiple models for our projects. This is where FakeIt stands out, it allows for multiple models and those models to have dependencies.<\/p>\n<p>Let&#8217;s take a look at the possible models we&#8217;ll have within our e-commerce application:<\/p>\n<ul>\n<li>Users<\/li>\n<li>Products<\/li>\n<li>Cart<\/li>\n<li>Orders<\/li>\n<li>Reviews<\/li>\n<\/ul>\n<p>Users, the first model that we defined does not have any dependencies and the same can be said for the Products model, which we will define next. However, it would be logical to say that our Orders model would depend on both the Users and Products model. If we truly want test data, the documents created by our Orders model should be the actual random data generated from both the Users and Products models.<\/p>\n<h3><strong>Products Model<\/strong><\/h3>\n<p>Before we look at how model dependencies work in FakeIt let&#8217;s define what our Products model is going to look like.<\/p>\n<pre class=\"lang:default decode:true\">name:\u00a0Products\r\ntype:\u00a0object\r\nkey:\u00a0_id\r\nproperties:\r\n\u00a0 _id:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The document id\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 post_build:\u00a0`product_${this.product_id}`\r\n\u00a0 doc_type:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The document type\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 value:\u00a0product\r\n\u00a0 product_id:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0Unique identifier representing a specific product\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.random.uuid()\r\n\u00a0 price:\r\n\u00a0 \u00a0 type:\u00a0double\r\n\u00a0 \u00a0 description:\u00a0The product price\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0chance.floating({ min: 0, max: 150, fixed: 2\u00a0})\r\n\u00a0 sale_price:\r\n\u00a0 \u00a0 type:\u00a0double\r\n\u00a0 \u00a0 description:\u00a0The product price\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 post_build:\u00a0|\r\n\u00a0 \u00a0 \u00a0 \u00a0let sale_price = 0;\r\n\u00a0 \u00a0 \u00a0 \u00a0if (chance.bool({ likelihood: 30 })) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0sale_price = chance.floating({ min: 0, max: this.price * chance.floating({ min: 0, max: 0.99, fixed: 2 }), fixed: 2 });\r\n\u00a0 \u00a0 \u00a0 \u00a0}\r\n\u00a0 \u00a0 \u00a0 \u00a0return sale_price;\r\n\u00a0 display_name:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0Display name of product.\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.commerce.productName()\r\n\u00a0 short_description:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0Description of product.\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.lorem.paragraphs(1)\r\n\u00a0 long_description:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0Description of product.\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.lorem.paragraphs(5)\r\n\u00a0 keywords:\r\n\u00a0 \u00a0 type:\u00a0array\r\n\u00a0 \u00a0 description:\u00a0An array of keywords\r\n\u00a0 \u00a0 items:\r\n\u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 min:\u00a00\r\n\u00a0 \u00a0 \u00a0 \u00a0 max:\u00a010\r\n\u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0faker.random.word()\r\n\u00a0 availability:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The availability status of the product\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0|\r\n\u00a0 \u00a0 \u00a0 \u00a0let availability = 'In-Stock';\r\n\u00a0 \u00a0 \u00a0 \u00a0if (chance.bool({ likelihood: 40 })) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0availability = faker.random.arrayElement([ 'Preorder', 'Out of Stock', 'Discontinued' ]);\r\n\u00a0 \u00a0 \u00a0 \u00a0}\r\n\u00a0 \u00a0 \u00a0 \u00a0return availability;\r\n\u00a0 availability_date:\r\n\u00a0 \u00a0 type:\u00a0integer\r\n\u00a0 \u00a0 description:\u00a0An epoch time of when the product is available\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.date.recent()\r\n\u00a0 \u00a0 \u00a0 post_build:\u00a0new Date(this.availability_date).getTime()\r\n\u00a0 product_slug:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The URL friendly version of the product name\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 post_build:\u00a0faker.helpers.slugify(this.display_name).toLowerCase()\r\n\u00a0 category:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0Category for the Product\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.commerce.department()\r\n\u00a0 category_slug:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The URL friendly version of the category name\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 post_build:\u00a0faker.helpers.slugify(this.category).toLowerCase()\r\n\u00a0 image:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0Image URL representing the product.\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.image.image()\r\n\u00a0 alternate_images:\r\n\u00a0 \u00a0 type:\u00a0array\r\n\u00a0 \u00a0 description:\u00a0An array of alternate images for the product\r\n\u00a0 \u00a0 items:\r\n\u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 min:\u00a00\r\n\u00a0 \u00a0 \u00a0 \u00a0 max:\u00a04\r\n\u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0faker.image.image()<\/pre>\n<p>This model is a little more complex than our previous Users model. Let&#8217;s examine a few of this property in more detail:<\/p>\n<ul>\n<li><strong>_id<\/strong>: This value is being set after every property in the document has been build and is available to the post build function. The this\u00a0context is that of the current document being generated<\/li>\n<li><strong>sale_price<\/strong>: This using defining a 30% chance of a sale price and if there is a sale price ensuring that the value is less than that of the price\u00a0property<\/li>\n<li><strong>keywords<\/strong>: Is an array. This defined similarly to Swagger, we define our array items and how we want them constructed using the build\u00a0\/ post_build\u00a0functions. Additionally, we can define min\u00a0and max\u00a0values and FakeIt will generate a random number of array elements between these values. There is also a fixed\u00a0property that can be used to generate a set number of array elements.<\/li>\n<\/ul>\n<p>Now that we&#8217;ve constructed our Products model let&#8217;s generate some random data and output it to the console to see what it looks like using the command:<\/p>\n<pre class=\"lang:default decode:true \">fakeit console models\/products.yaml<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5702 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/blog2-example1-1-compressor.gif\" alt=\"Blog 2 example1-1\" width=\"800\" height=\"448\" \/><\/p>\n<h3><strong>Orders Model<\/strong><\/h3>\n<p>For our project we have already defined the following models:<\/p>\n<ul>\n<li>users.yaml<\/li>\n<li>products.yaml<\/li>\n<\/ul>\n<p>Let&#8217;s start by defining or Orders model without any properties and specifying its dependencies:<\/p>\n<pre class=\"lang:default decode:true\">name:\u00a0Orders\r\ntype:\u00a0object\r\nkey:\u00a0_id\r\ndata:\r\n\u00a0 dependencies:\r\n\u00a0 \u00a0 -\u00a0products.yaml\r\n\u00a0 \u00a0 -\u00a0users.yaml\r\nproperties:<\/pre>\n<p>We have defined two dependencies for our Orders model, and referenced them by their file name. Since all of our models are stored in the same directory there is no reason to specify the full path. At runtime,\u00a0FakeIt will first parse all of the models before attempting to generate documents, and it will determine a run order based on each of the models dependencies (if any).<\/p>\n<p>Each of the build functions in a FakeIt model is a function body, with the following arguments passed to it.<\/p>\n<pre class=\"lang:default decode:true\">function\u00a0(documents, globals, inputs, faker, chance, document_index, require) {\r\n\u00a0return\u00a0faker.internet.userName();\r\n}\r\n\r\n<\/pre>\n<p>Once the run order has been established, each of the dependencies are saved in-memory and made available to the dependant model through the documents\u00a0argument. This argument is an object containing a key for each model whose value is an array of each document that has been generated. For our example of the documents property it will look similar to this:<\/p>\n<pre class=\"lang:default decode:true\">{\r\n\u00a0\"Users\": [\r\n\u00a0 \u00a0...\r\n\u00a0],\r\n\u00a0\"Products\": [\r\n\u00a0 \u00a0...\r\n\u00a0]\r\n}\r\n\r\n<\/pre>\n<p>We can take advantage of this to retrieve random Product and User documents assigning their properties to properties within our Orders model. For example,\u00a0we can retrieve a random user_id\u00a0from the documents generated by the Users model and assign that to the user_id\u00a0of the Orders model through a build function<\/p>\n<pre class=\"lang:default decode:true\">user_id:\r\n\u00a0 \u00a0 type:\u00a0integer\r\n\u00a0 \u00a0 description:\u00a0The user_id that placed the order\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.random.arrayElement(documents.Users).user_id;<\/pre>\n<p>Let&#8217;s define what the\u00a0rest of our\u00a0Orders model will look like:<\/p>\n<pre class=\"lang:default decode:true\">name:\u00a0Orders\r\ntype:\u00a0object\r\nkey:\u00a0_id\r\ndata:\r\n\u00a0 dependencies:\r\n\u00a0 \u00a0 -\u00a0products.yaml\r\n\u00a0 \u00a0 -\u00a0users.yaml\r\nproperties:\r\n\u00a0 _id:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The document id\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 post_build:\u00a0`order_${this.order_id}`\r\n\u00a0 doc_type:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The document type\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 value:\u00a0\"order\"\r\n\u00a0 order_id:\r\n\u00a0 \u00a0 type:\u00a0integer\r\n\u00a0 \u00a0 description:\u00a0The order_id\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0document_index + 1\r\n\u00a0 user_id:\r\n\u00a0 \u00a0 type:\u00a0integer\r\n\u00a0 \u00a0 description:\u00a0The user_id that placed the order\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.random.arrayElement(documents.Users).user_id;\r\n\u00a0 order_date:\r\n\u00a0 \u00a0 type:\u00a0integer\r\n\u00a0 \u00a0 description:\u00a0An epoch time of when the order was placed\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0new Date(faker.date.past()).getTime()\r\n\u00a0 order_status:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The status of the order\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.random.arrayElement([ 'Pending', 'Processing', 'Cancelled', 'Shipped'\u00a0])\r\n\u00a0 billing_name:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The name of the person the order is to be billed to\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0`${faker.name.firstName()} ${faker.name.lastName()}`\r\n\u00a0 billing_phone:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The billing phone\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.phone.phoneNumber().replace(\/x[0-9]+$\/, '')\r\n\u00a0 billing_email:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The billing email\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.internet.email()\r\n\u00a0 billing_address_1:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The billing address 1\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0`${faker.address.streetAddress()} ${faker.address.streetSuffix()}`\r\n\u00a0 billing_address_2:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The billing address 2\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0chance.bool({ likelihood: 50\u00a0}) ? faker.address.secondaryAddress() : null\r\n\u00a0 billing_locality:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The billing city\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.address.city()\r\n\u00a0 billing_region:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The billing region, city, province\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.address.stateAbbr()\r\n\u00a0 billing_postal_code:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The billing zip code \/ postal code\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.address.zipCode()\r\n\u00a0 billing_country:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The billing region, city, province\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 value:\u00a0US\r\n\u00a0 shipping_name:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The name of the person the order is to be billed to\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0`${faker.name.firstName()} ${faker.name.lastName()}`\r\n\u00a0 shipping_address_1:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The shipping address 1\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0`${faker.address.streetAddress()} ${faker.address.streetSuffix()}`\r\n\u00a0 shipping_address_2:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The shipping address 2\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0chance.bool({ likelihood: 50\u00a0}) ? faker.address.secondaryAddress() : null\r\n\u00a0 shipping_locality:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The shipping city\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.address.city()\r\n\u00a0 shipping_region:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The shipping region, city, province\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.address.stateAbbr()\r\n\u00a0 shipping_postal_code:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The shipping zip code \/ postal code\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.address.zipCode()\r\n\u00a0 shipping_country:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The shipping region, city, province\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 value:\u00a0US\r\n\u00a0 shipping_method:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The shipping method\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.random.arrayElement([ 'USPS', 'UPS Standard', 'UPS Ground', 'UPS 2nd Day Air', 'UPS Next Day Air', 'FedEx Ground', 'FedEx 2Day Air', 'FedEx Standard Overnight'\u00a0]);\r\n\u00a0 shipping_total:\r\n\u00a0 \u00a0 type:\u00a0double\r\n\u00a0 \u00a0 description:\u00a0The shipping total\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0chance.dollar({ min: 10, max: 50\u00a0}).slice(1)\r\n\u00a0 tax:\r\n\u00a0 \u00a0 type:\u00a0double\r\n\u00a0 \u00a0 description:\u00a0The tax total\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0chance.dollar({ min: 2, max: 10\u00a0}).slice(1)\r\n\u00a0 line_items:\r\n\u00a0 \u00a0 type:\u00a0array\r\n\u00a0 \u00a0 description:\u00a0The products that were ordered\r\n\u00a0 \u00a0 items:\r\n\u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 min:\u00a01\r\n\u00a0 \u00a0 \u00a0 \u00a0 max:\u00a05\r\n\u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0|\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0const random = faker.random.arrayElement(documents.Products);\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0const product = {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 product_id:\u00a0random.product_id,\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 display_name:\u00a0random.display_name,\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 short_description:\u00a0random.short_description,\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 image:\u00a0random.image,\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 price:\u00a0random.sale_price || random.price,\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 qty:\u00a0faker.random.number({ min: 1, max: 5\u00a0}),\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0};\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0product.sub_total = product.qty * product.price;\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0return product;\r\n\u00a0 grand_total:\r\n\u00a0 \u00a0 type:\u00a0double\r\n\u00a0 \u00a0 description:\u00a0The grand total of the order\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 post_build:\u00a0|\r\n\u00a0 \u00a0 \u00a0 \u00a0let total = this.tax + this.shipping_total;\r\n\u00a0 \u00a0 \u00a0 \u00a0for (let i = 0; i &lt; this.line_items.length; i++) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0total += this.line_items[i].sub_total;\r\n\u00a0 \u00a0 \u00a0 \u00a0}\r\n\u00a0 \u00a0 \u00a0 \u00a0return chance.dollar({ min: total, max: total }).slice(1);\r\n\r\n<\/pre>\n<p>And output it to the console using the command:<\/p>\n<pre class=\"lang:default decode:true \">fakeit console models\/orders.yaml<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5703 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/blog2-example2-1-compressor.gif\" alt=\"blog example2-1\" width=\"800\" height=\"448\" \/><\/p>\n<p>As you can see from the console output, the documents were generated for the Users and Products models, and those documents were made available to the Orders model. However, they were excluded from output because all that was requested to be output was the Orders model.<\/p>\n<p>Now that we have defined 3 models with dependencies (Users, Products and Orders), we need to be able to generate multiple documents for each of these and output them to Couchbase Server. Up to this point we have been specifying the number of documents to generate via the &#8211;count\u00a0command line argument. We can specify the number of documents or a range of documents by using the data:\u00a0property at the root of the model.<\/p>\n<pre class=\"lang:default decode:true\">users.yaml\r\n\r\nname:\u00a0Users\r\ntype:\u00a0object\r\nkey:\u00a0_id\r\ndata:\r\n\u00a0 min:\u00a01000\r\n\u00a0 max:\u00a02000<\/pre>\n<pre class=\"lang:default decode:true \">products.yaml\r\n\r\nname:\u00a0Products\r\ntype:\u00a0object\r\nkey:\u00a0_id\r\ndata:\r\n\u00a0 min:\u00a04000\r\n\u00a0 max:\u00a05000<\/pre>\n<pre class=\"lang:default decode:true \">orders.yaml\r\n\r\nname:\u00a0Orders\r\ntype:\u00a0object\r\nkey:\u00a0_id\r\ndata:\r\n\u00a0 dependencies:\r\n\u00a0 \u00a0 -\u00a0products.yaml\r\n\u00a0 \u00a0 -\u00a0users.yaml\r\n\u00a0 min:\u00a05000\r\n\u00a0 max:\u00a06000<\/pre>\n<p>We can now generate random sets of related document models and output those documents directly into Couchbase Server using the command:<\/p>\n<pre class=\"lang:default decode:true \">fakeit couchbase --server 127.0.0.1 --bucket ecommerce --verbose models\/\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5700 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/blog2-example3-1-compressor.gif\" alt=\"Blog 2 Example 3-1\" width=\"800\" height=\"440\" \/><\/p>\n<h3><strong>Conclusion<\/strong><\/h3>\n<p>We&#8217;ve seen through three simple FakeIt YAML models how we can create model dependencies allowing for randomly generated data to be related across models and streamed into Couchbase Server. We&#8217;ve also seen how we can specify the number of documents to generate by model by using the data:\u00a0property at the root of a model.<\/p>\n<p>These models can be stored in your projects repository, taking up very little space and allow your developers to generate the same data structures with completely different data. Another advantage of being able to generate documents through multi-model relationships is to explore different document models and see how they perform with various N1QL queries.<\/p>\n<h4><strong>Up Next<\/strong><\/h4>\n<ul>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-3-5-lean-models-through-definitions\/\">FakeIt Series 3 of 5: Lean Models through Definitions<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/\">FakeIt Series 4 of 5: Working with Existing Data<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-5-5-rapid-mobile-development-sync-gateway\/\">FakeIt Series 5 of 5: Rapid Mobile Development w\/ Sync-Gateway<\/a><\/li>\n<\/ul>\n<h4><strong>Previous<\/strong><\/h4>\n<ul>\n<li>FakeIt Series 1 of 5: <a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-generating-fake-data\/\">Generating Fake Data<\/a><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2966 aligncenter\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/brand.devCommChampionLogo.champion.FINAL_-300x300.png\" alt=\"Couchbase Champion\" width=\"300\" height=\"300\" \/>\u00a0<a href=\"https:\/\/www.couchbase.com\/community\/community-writers-program\/\"><em>This post is part of the Couchbase Community Writing Program<\/em><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are tons of random data generators available, a simple Google Search will give you more than enough to choose from. However, almost all of these have the same frustrating flaw, which is they can only ever deal with a single model. Rarely as developers do we have the luxury of dealing with a single model, more often than not we are developing against multiple models for our projects. This is where FakeIt stands out, it allows for multiple models and those models to have dependencies.<\/p>\n","protected":false},"author":53,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1816,1819],"tags":[1883,1884],"ppma_author":[9026],"class_list":["post-2953","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server","category-data-modeling","tag-data-modelling","tag-document-patterns"],"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>FakeIt Series 2 of 5: Shared Data and Dependencies - The Couchbase Blog<\/title>\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\/fakeit-series-shared-data-dependencies\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FakeIt Series 2 of 5: Shared Data and Dependencies\" \/>\n<meta property=\"og:description\" content=\"There are tons of random data generators available, a simple Google Search will give you more than enough to choose from. However, almost all of these have the same frustrating flaw, which is they can only ever deal with a single model. Rarely as developers do we have the luxury of dealing with a single model, more often than not we are developing against multiple models for our projects. This is where FakeIt stands out, it allows for multiple models and those models to have dependencies.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-16T13:58:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-19T10:19:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/aaronb-benton-headshot_1000x1000-300x300.jpg\" \/>\n<meta name=\"author\" content=\"Laura Czajkowski, Developer Community Manager, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Laura Czajkowski, Developer Community Manager, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/\"},\"author\":{\"name\":\"Laura Czajkowski, Developer Community Manager, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220\"},\"headline\":\"FakeIt Series 2 of 5: Shared Data and Dependencies\",\"datePublished\":\"2017-03-16T13:58:49+00:00\",\"dateModified\":\"2023-06-19T10:19:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/\"},\"wordCount\":1058,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"data modelling\",\"document patterns\"],\"articleSection\":[\"Couchbase Server\",\"Data Modeling\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/\",\"name\":\"FakeIt Series 2 of 5: Shared Data and Dependencies - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-03-16T13:58:49+00:00\",\"dateModified\":\"2023-06-19T10:19:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#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\/fakeit-series-shared-data-dependencies\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FakeIt Series 2 of 5: Shared Data and Dependencies\"}]},{\"@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\/5f1a0ece4e644bc8c037686fbc8f3220\",\"name\":\"Laura Czajkowski, Developer Community Manager, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/9deb07d5daaa00220534c31768bc4409\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g\",\"caption\":\"Laura Czajkowski, Developer Community Manager, Couchbase\"},\"description\":\"Laura Czajkowski is the Snr. Developer Community Manager at Couchbase overseeing the community. She\u2019s responsible for our monthly developer newsletter.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/laura-czajkowski\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"FakeIt Series 2 of 5: Shared Data and Dependencies - The Couchbase Blog","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\/fakeit-series-shared-data-dependencies\/","og_locale":"en_US","og_type":"article","og_title":"FakeIt Series 2 of 5: Shared Data and Dependencies","og_description":"There are tons of random data generators available, a simple Google Search will give you more than enough to choose from. However, almost all of these have the same frustrating flaw, which is they can only ever deal with a single model. Rarely as developers do we have the luxury of dealing with a single model, more often than not we are developing against multiple models for our projects. This is where FakeIt stands out, it allows for multiple models and those models to have dependencies.","og_url":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-03-16T13:58:49+00:00","article_modified_time":"2023-06-19T10:19:59+00:00","og_image":[{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/aaronb-benton-headshot_1000x1000-300x300.jpg","type":"","width":"","height":""}],"author":"Laura Czajkowski, Developer Community Manager, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Laura Czajkowski, Developer Community Manager, Couchbase","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/"},"author":{"name":"Laura Czajkowski, Developer Community Manager, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220"},"headline":"FakeIt Series 2 of 5: Shared Data and Dependencies","datePublished":"2017-03-16T13:58:49+00:00","dateModified":"2023-06-19T10:19:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/"},"wordCount":1058,"commentCount":2,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["data modelling","document patterns"],"articleSection":["Couchbase Server","Data Modeling"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/","url":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/","name":"FakeIt Series 2 of 5: Shared Data and Dependencies - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-03-16T13:58:49+00:00","dateModified":"2023-06-19T10:19:59+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/#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\/fakeit-series-shared-data-dependencies\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"FakeIt Series 2 of 5: Shared Data and Dependencies"}]},{"@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\/5f1a0ece4e644bc8c037686fbc8f3220","name":"Laura Czajkowski, Developer Community Manager, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/9deb07d5daaa00220534c31768bc4409","url":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","caption":"Laura Czajkowski, Developer Community Manager, Couchbase"},"description":"Laura Czajkowski is the Snr. Developer Community Manager at Couchbase overseeing the community. She\u2019s responsible for our monthly developer newsletter.","url":"https:\/\/www.couchbase.com\/blog\/author\/laura-czajkowski\/"}]}},"authors":[{"term_id":9026,"user_id":53,"is_guest":0,"slug":"laura-czajkowski","display_name":"Laura Czajkowski, Developer Community Manager, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","author_category":"","last_name":"Czajkowski","first_name":"Laura","job_title":"","user_url":"","description":"Laura Czajkowski is the Snr. Developer Community Manager at Couchbase overseeing the community. She\u2019s responsible for our monthly developer newsletter."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2953","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\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2953"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2953\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2953"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}