{"id":3187,"date":"2017-04-06T10:36:30","date_gmt":"2017-04-06T17:36:30","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=3187"},"modified":"2023-06-19T03:02:33","modified_gmt":"2023-06-19T10:02:33","slug":"fakeit-series-working-existing-data","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/","title":{"rendered":"FakeIt Series 4 of 5: Working with Existing Data"},"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<h3><strong>FakeIt Series 4 of 5: Working with Existing Data<\/strong><\/h3>\n<p>So far in our <u><a href=\"https:\/\/github.com\/bentonam\/fakeit\" target=\"_blank\" rel=\"noopener noreferrer\">FakeIt<\/a><\/u>\u00a0series we&#8217;ve seen how we can <u><a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-generating-fake-data\/\" target=\"_blank\" rel=\"noopener noreferrer\">Generate Fake Data<\/a><\/u>, <u><a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/\" target=\"_blank\" rel=\"noopener noreferrer\">Share Data and Dependencies<\/a><\/u>, and use <a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-3-5-lean-models-through-definitions\/\">Definitions\u00a0for smaller models<\/a>. Today we are going to look at the last major feature of FakeIt, which is working with existing data through inputs.<\/p>\n<p>Rarely as developers do we get the advantage of working on greenfield applications, our domains are more often than not a comprised of different legacy databases and applications. As we are modeling and building new applications, we need to reference and use this existing data. \u00a0<u><a href=\"https:\/\/github.com\/bentonam\/fakeit\" target=\"_blank\" rel=\"noopener noreferrer\">FakeIt<\/a><\/u>\u00a0allows you to provide existing data to your models through JSON, CSV or CSON files. This data is exposed as an inputs\u00a0variable in each of a models *run\u00a0and *build\u00a0functions.<\/p>\n<h3><strong>Users Model<\/strong><\/h3>\n<p>We will start with our users.yaml\u00a0model that we updated to in our most <u><a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-generating-fake-data\/\" target=\"_blank\" rel=\"noopener noreferrer\">recent post<\/a><\/u>\u00a0to use <strong>Address <\/strong>and <strong>Phone<\/strong>\u00a0definitions.<\/p>\n<pre class=\"lang:default decode:true \">name:\u00a0Users\r\ntype:\u00a0object\r\nkey:\u00a0_id\r\ndata:\r\n\u00a0 min:\u00a01000\r\n\u00a0 max:\u00a02000\r\nproperties:\r\n\u00a0 _id:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The document id built by the prefix \"user_\"\u00a0and the users id\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 post_build:\u00a0\"`user_${this.user_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\"user\"\r\n\u00a0 user_id:\r\n\u00a0 \u00a0 type:\u00a0integer\r\n\u00a0 \u00a0 description:\u00a0An auto-incrementing number\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0document_index\r\n\u00a0 first_name:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The users first name\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.name.firstName()\r\n\u00a0 last_name:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The users last name\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.name.lastName()\r\n\u00a0 username:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The username\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.internet.userName()\r\n\u00a0 password:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The users password\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.internet.password()\r\n\u00a0 email_address:\r\n\u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 description:\u00a0The users email address\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0faker.internet.email()\r\n\u00a0 created_on:\r\n\u00a0 \u00a0 type:\u00a0integer\r\n\u00a0 \u00a0 description:\u00a0An epoch time of when the user was created\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0new Date(faker.date.past()).getTime()\r\n\u00a0 addresses:\r\n\u00a0 \u00a0 type:\u00a0object\r\n\u00a0 \u00a0 description:\u00a0An object containing the home and work addresses for the user\r\n\u00a0 \u00a0 properties:\r\n\u00a0 \u00a0 \u00a0 home:\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The users home address\r\n\u00a0 \u00a0 \u00a0 \u00a0 schema:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0$ref: '#\/definitions\/Address'\r\n\u00a0 \u00a0 \u00a0 work:\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The users work address\r\n\u00a0 \u00a0 \u00a0 \u00a0 schema:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0$ref: '#\/definitions\/Address'\r\n\u00a0 main_phone:\r\n\u00a0 \u00a0 description:\u00a0The users main phone number\r\n\u00a0 \u00a0 schema:\r\n\u00a0 \u00a0 \u00a0$ref: '#\/definitions\/Phone'\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 post_build:\u00a0|\r\n\u00a0 \u00a0 \u00a0 \u00a0delete this.main_phone.type\r\n\u00a0 \u00a0 \u00a0 \u00a0return this.main_phone\r\n\u00a0 additional_phones:\r\n\u00a0 \u00a0 type:\u00a0array\r\n\u00a0 \u00a0 description:\u00a0The users additional phone numbers\r\n\u00a0 \u00a0 items:\r\n\u00a0 \u00a0 \u00a0$ref: '#\/definitions\/Phone'\r\n\u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 min:\u00a01\r\n\u00a0 \u00a0 \u00a0 \u00a0 max:\u00a04\r\ndefinitions:\r\n\u00a0 Phone:\r\n\u00a0 \u00a0 type:\u00a0object\r\n\u00a0 \u00a0 properties:\r\n\u00a0 \u00a0 \u00a0 type:\r\n\u00a0 \u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The phone type\r\n\u00a0 \u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0faker.random.arrayElement([ 'Home', 'Work', 'Mobile', 'Other'\u00a0])\r\n\u00a0 \u00a0 \u00a0 phone_number:\r\n\u00a0 \u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The phone number\r\n\u00a0 \u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0faker.phone.phoneNumber().replace(\/[^0-9]+\/g, '')\r\n\u00a0 \u00a0 \u00a0 extension:\r\n\u00a0 \u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The phone extension\r\n\u00a0 \u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0chance.bool({ likelihood: 30\u00a0}) ? chance.integer({ min: 1000, max: 9999\u00a0}) : null\r\n\u00a0 Address:\r\n\u00a0 \u00a0 type:\u00a0object\r\n\u00a0 \u00a0 properties:\r\n\u00a0 \u00a0 \u00a0 address_1:\r\n\u00a0 \u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The address 1\r\n\u00a0 \u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0`${faker.address.streetAddress()} ${faker.address.streetSuffix()}`\r\n\u00a0 \u00a0 \u00a0 address_2:\r\n\u00a0 \u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The address 2\r\n\u00a0 \u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0chance.bool({ likelihood: 35\u00a0}) ? faker.address.secondaryAddress() : null\r\n\u00a0 \u00a0 \u00a0 locality:\r\n\u00a0 \u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The city \/ locality\r\n\u00a0 \u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0faker.address.city()\r\n\u00a0 \u00a0 \u00a0 region:\r\n\u00a0 \u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The region \/ state \/ province\r\n\u00a0 \u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0faker.address.stateAbbr()\r\n\u00a0 \u00a0 \u00a0 postal_code:\r\n\u00a0 \u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The zip code \/ postal code\r\n\u00a0 \u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0faker.address.zipCode()\r\n\u00a0 \u00a0 \u00a0 country:\r\n\u00a0 \u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The country code\r\n\u00a0 \u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0faker.address.countryCode()<\/pre>\n<p>&nbsp;<\/p>\n<p>Currently, our <strong>Address<\/strong>\u00a0definition is generating a random country. What if our ecommerce site only supports a small subset of the 195 countries? Let&#8217;s say we support six countries to start with: US, CA, MX, UK, ES, DE. We could update the definitions country\u00a0property to grab a random array element:<\/p>\n<p><em>(For brevity the other properties have been left off of the model definition)<\/em><\/p>\n<pre class=\"lang:default decode:true \">...\r\n\u00a0 \u00a0 \u00a0 country:\r\n\u00a0 \u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The country code\r\n\u00a0 \u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0faker.random.arrayElement(['US', 'CA', 'MX', 'UK', 'ES', 'DE']);<\/pre>\n<p>While this would work, what if we have other models that rely on this same country info, we would have to duplicate this logic. We can achieve this same thing by creating a countries.json\u00a0file, and adding an inputs\u00a0property to the data\u00a0property that can be an absolute or relative path to our input. When are model is generated, our countries.json\u00a0file will be exposed to each of the models build functions via the inputs\u00a0argument as inputs.countries<\/p>\n<p><em>(For brevity the other properties have been left off of the model definition)<\/em><\/p>\n<pre class=\"lang:default decode:true\">name:\u00a0Users\r\ntype:\u00a0object\r\nkey:\u00a0_id\r\ndata:\r\n\u00a0 min:\u00a01000\r\n\u00a0 max:\u00a02000\r\n\u00a0 inputs:\u00a0.\/countries.json\r\nproperties:\r\n...\r\ndefinitions:\r\n...\r\n\u00a0 \u00a0 \u00a0 country:\r\n\u00a0 \u00a0 \u00a0 \u00a0 type:\u00a0string\r\n\u00a0 \u00a0 \u00a0 \u00a0 description:\u00a0The country code\r\n\u00a0 \u00a0 \u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 build:\u00a0faker.random.arrayElement(inputs.countries);\r\n\r\ncountries.json\r\n\r\n[\r\n\u00a0\"US\",\r\n\u00a0\"CA\",\r\n\u00a0\"MX\",\r\n\u00a0\"UK\",\r\n\u00a0\"ES\",\r\n\u00a0\"DE\"\r\n]<\/pre>\n<p>By changing one existing line and adding another line in model we have provided existing data to our Users model. We can still generate a random country, based on the countries our application supports. Lets test our changes by using the following command:<\/p>\n<pre class=\"lang:default decode:true\">fakeit console --count 1 models\/users.yaml\r\n\r\n<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/04\/blog4-example1.gif\" alt=\"blog4 example1\" \/><\/p>\n<h3><strong>Products Model<\/strong><\/h3>\n<p>Our ecommerce application is using a separate system for categorization, we need to expose that data to our randomly generated products so that we are using valid category information. We will start with the products.yaml\u00a0that we defined in the <u><a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/\" target=\"_blank\" rel=\"noopener noreferrer\">FakeIt Series 2 of 5: Shared Data and Dependencies<\/a><\/u>\u00a0post.<\/p>\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\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>Our existing categories data has been provided in CSV format.<\/p>\n<pre class=\"lang:default decode:true \">categories.csv\r\n\r\n\"category_id\",\"category_name\",\"category_slug\"\r\n23,\"Electronics\",\"electronics\"\r\n1032,\"Office Supplies\",\"office-supplies\"\r\n983,\"Clothing &amp; Apparel\",\"clothing-and-apparel\"\r\n483,\"Movies, Music &amp; Books\",\"movies-music-and-books\"\r\n3023,\"Sports &amp; Fitness\",\"sports-and-fitness\"\r\n4935,\"Automotive\",\"automotive\"\r\n923,\"Tools\",\"tools\"\r\n5782,\"Home Furniture\",\"home-furniture\"\r\n9783,\"Health &amp; Beauty\",\"health-and-beauty\"\r\n2537,\"Toys\",\"toys\"\r\n10,\"Video Games\",\"video-games\"\r\n736,\"Pet Supplies\",\"pet-supplies\"<\/pre>\n<p>Now we need to update our products.yaml\u00a0model to use this existing data.<\/p>\n<p><em>(For brevity the other properties have been left off of the model definition)<\/em><\/p>\n<pre class=\"lang:default decode:true\">name:\u00a0Products\r\ntype:\u00a0object\r\nkey:\u00a0_id\r\ndata:\r\n\u00a0 min:\u00a04000\r\n\u00a0 max:\u00a05000\r\n\u00a0 inputs:\r\n\u00a0 \u00a0 -\u00a0.\/categories.csv\r\n\u00a0 pre_build:\u00a0globals.current_category = faker.random.arrayElement(inputs.categories);\r\nproperties:\r\n...\r\n\u00a0 category_id:\r\n\u00a0 \u00a0 type:\u00a0integer\r\n\u00a0 \u00a0 description:\u00a0The Category ID for the Product\r\n\u00a0 \u00a0 data:\r\n\u00a0 \u00a0 \u00a0 build:\u00a0globals.current_category.category_id\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:\u00a0globals.current_category.category_name\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:\u00a0globals.current_category.category_slug\r\n...<\/pre>\n<p>There are a few things to notice about how we&#8217;ve updated our products.yaml\u00a0model.<\/p>\n<ul>\n<li>inputs:\u00a0is defined as an array not a string. While we are only using a single input, you can provide as many input files to your model as necessary.<\/li>\n<li>A pre_build\u00a0function is defined at the root of the model. This is because we cannot grab a random array element for each of our three category properties as the values would not match. Each time an individual document is generated for our model, this pre_build\u00a0function will run first.<\/li>\n<li>Each of our category properties build\u00a0functions reference the global variable set by the pre_build\u00a0function on our model.<\/li>\n<\/ul>\n<p>We can test our changes by using the following command:<\/p>\n<pre class=\"lang:default decode:true\">fakeit console --count 1 models\/products.yaml<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5689 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/04\/blog4-example2-compressor.gif\" alt=\"blog4 example2\" width=\"800\" height=\"443\" \/><\/p>\n<h3><strong>Conclusion<\/strong><\/h3>\n<p>Being able to work with existing data is an extremely powerful feature of <u><a href=\"https:\/\/github.com\/bentonam\/fakeit\" target=\"_blank\" rel=\"noopener noreferrer\">FakeIt<\/a><\/u>. It can be used to maintain the integrity of randomly generated documents to work with existing system, and can even be used to transform existing data and import it into Couchbase Server.<\/p>\n<h4><strong>Up Next<\/strong><\/h4>\n<ul>\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><u><a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-generating-fake-data\/\" target=\"_blank\" rel=\"noopener noreferrer\">FakeIt Series 1 of 5: Generating Fake Data<\/a><\/u><\/li>\n<li><u><a href=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-shared-data-dependencies\/\" target=\"_blank\" rel=\"noopener noreferrer\">FakeIt Series 2 of 5: Shared Data and Dependencies<\/a><\/u><\/li>\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<\/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\" \/><\/p>\n<p><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>FakeIt allows you to provide existing data to your models through JSON, CSV or CSON files. This data is exposed as an inputs variable in each of a models *run and *build functions.<\/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,1885],"ppma_author":[9026],"class_list":["post-3187","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server","category-data-modeling","tag-data-modelling","tag-document-patterns","tag-fakeit"],"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 4 of 5: Working with Existing Data - 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-working-existing-data\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FakeIt Series 4 of 5: Working with Existing Data\" \/>\n<meta property=\"og:description\" content=\"FakeIt allows you to provide existing data to your models through JSON, CSV or CSON files. This data is exposed as an inputs variable in each of a models *run and *build functions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-06T17:36:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-19T10:02:33+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=\"8 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-working-existing-data\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/\"},\"author\":{\"name\":\"Laura Czajkowski, Developer Community Manager, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220\"},\"headline\":\"FakeIt Series 4 of 5: Working with Existing Data\",\"datePublished\":\"2017-04-06T17:36:30+00:00\",\"dateModified\":\"2023-06-19T10:02:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/\"},\"wordCount\":721,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"data modelling\",\"document patterns\",\"fakeit\"],\"articleSection\":[\"Couchbase Server\",\"Data Modeling\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/\",\"name\":\"FakeIt Series 4 of 5: Working with Existing Data - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-04-06T17:36:30+00:00\",\"dateModified\":\"2023-06-19T10:02:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#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-working-existing-data\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FakeIt Series 4 of 5: Working with Existing Data\"}]},{\"@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 4 of 5: Working with Existing Data - 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-working-existing-data\/","og_locale":"en_US","og_type":"article","og_title":"FakeIt Series 4 of 5: Working with Existing Data","og_description":"FakeIt allows you to provide existing data to your models through JSON, CSV or CSON files. This data is exposed as an inputs variable in each of a models *run and *build functions.","og_url":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-04-06T17:36:30+00:00","article_modified_time":"2023-06-19T10:02:33+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":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/"},"author":{"name":"Laura Czajkowski, Developer Community Manager, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220"},"headline":"FakeIt Series 4 of 5: Working with Existing Data","datePublished":"2017-04-06T17:36:30+00:00","dateModified":"2023-06-19T10:02:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/"},"wordCount":721,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["data modelling","document patterns","fakeit"],"articleSection":["Couchbase Server","Data Modeling"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/","url":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/","name":"FakeIt Series 4 of 5: Working with Existing Data - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-04-06T17:36:30+00:00","dateModified":"2023-06-19T10:02:33+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/fakeit-series-working-existing-data\/#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-working-existing-data\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"FakeIt Series 4 of 5: Working with Existing Data"}]},{"@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\/3187","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=3187"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/3187\/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=3187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=3187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=3187"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=3187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}