{"id":447,"date":"2015-11-25T18:20:49","date_gmt":"2015-11-25T18:20:49","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/"},"modified":"2015-11-25T18:20:49","modified_gmt":"2015-11-25T18:20:49","slug":"bulk-loading-documents-into-couchbase","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/es\/bulk-loading-documents-into-couchbase\/","title":{"rendered":"Converting CSV data to JSON and Bulk Loading Documents into Couchbase"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Bulk Loading Documents into<em>\u00a0<\/em>Couchbase<\/h2>\n\n\n\n<p>This blog post\u00a0is an example of how one might load data as JSON into Couchbase. For the purpose of this post, data extracted from RDBMS as a CSV will be converted to JSON.\u00a0RDBMS DBAs and Admins familiar with Oracle, SQL server, MySQL, etc are probably looking for a way to experiment and test with NoSQL.\u00a0Often the first step in using NoSQL is to convert whatever you have into JSON<strong>.\u00a0<\/strong><\/p>\n\n\n\n<p>Couchbase supports JSON and Binary data, but for the purpose of this post we are looking at the most rich data type, JSON.This is important to understand because by loading documents into Couchbase in a format other than JSON, data will be loaded as binary and may impact view flexibility when trying to build views or indexes. With that, let&#8217;s get on with loading some documents. There are two ways to achieve this but for the purpose of this post I&#8217;m assuming that any document you want loaded is already in JSON format and either compressed or uncompressed. The next section will describe one possible path to ensure you are loading JSON data.<\/p>\n\n\n\n<p>Some Couchbase ETL partners, such as\u00a0<a href=\"https:\/\/docs.couchbase.com\/admin\/talend\/talend.html\">Talend<\/a>,\u00a0which offers\u00a0a connector for Couchbase if you want a GUI, maybe\u00a0don&#8217;t want to deal with\u00a0CSV files or want to reorder your data prior to commiting your data to CSV or just have a need to ETL data from several sources before storing within Couchbase Server. Talend can map and store documents directly as JSON files prior to loading into Couchbase,\u00a0\u00a0if desired .<\/p>\n\n\n\n<p>This guide assumes you have some familiarity with Linux or Mac, package managers, and Ruby.<\/p>\n\n\n\n<p>For additional SDK setup information please visit: <a href=\"https:\/\/www.couchbase.com\/developers\/\">www.couchbase.com\/developers\/<\/a><\/p>\n\n\n\n<p>The steps used to prep and load the data\u00a0are\u00a0as follows:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Prepare the data<\/strong>: Look at a couple of example tools to convert the CSV\u00a0to JSON.<\/li>\n\n\n<li><strong>Load the data<\/strong>: Examine a few methods to load the data into couchbase via Ruby scripts.<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites for\u00a0Linux and Mac: <em>Requires a functional build environment!<\/em><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Libcouchbase: Since this script uses Ruby you must have libcouchbase installed prior to installing the couchbase gem\n<ul>\n<li><a href=\"https:\/\/docs.couchbase.com\/couchbase-sdk-ruby-1.3\/index.html#installing-the-couchbase-client-libraries\">Installing C Client Libraries<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n<li>rubygem: be sure that you have rubygems available to install the ruby couchbase wrapper\n<ul>\n<li>Gems that I used are\n<ul>\n<li>&#8216;ruby-progressbar&#8217;<\/li>\n<li>&#8216;couchbase&#8217;<\/li>\n<li>&#8216;yaji&#8217;<\/li>\n<li>&#8216;optparse&#8217;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n<li>Yajl parser: this must also be installed as a prerequisite to YAJI.\n<ul>\n<li><a href=\"https:\/\/github.com\/avsej\/yaji\">YAJI Parser Page with libyajl instructions<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n<li>Install Couchbase Gem: <em>gem install couchbase<\/em><\/li>\n\n<\/ol>\n\n\n\n<p>If the setup has been successful the ruby\u00a0scripts I&#8217;ve provided should run. You may want to pass -h to the streamloader and ensure you get the syntax message.\u00a0Lastly, don&#8217;t forget to install the GEMs listed as well, Yaji, optparse, couchbase, and ruby-progressbar. Links are provided at the bottom of this post.<\/p>\n\n\n\n<p><strong>Prepare the Data<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><u>Data Prep Method 1: Simple, speedy and consistent: <em>csvtojson<\/em> NodeJS script<\/u><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Can be found via Google for and there are others too.<\/li>\n\n\n<li>Installs via NPM ala <em>`npm install -g csvtojson`<\/em><\/li>\n\n<\/ul>\n\n\n\n<p>Here is an example conversion for reference:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Austins-MBP:complaintstemp austin$ npm info csvtojson\r\n{ name: &#039;csvtojson&#039;,\r\n  description: &#039;A tool concentrating on converting csv data to JSON with customised parser supporting&#039;,\r\n  &#039;dist-tags&#039;: { latest: &#039;0.3.21&#039; },\r\nAustins-MBP:complaintstemp austin$ which csvtojson\r\n\/usr\/local\/bin\/csvtojson\r\nAustins-MBP:complaintstemp austin$ csvtojson data.gov_Consumer_Complaints.csv<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><u>Data Prep Method 2: Write a Ruby Script: <em>csv2json.rb<\/em>\u00a0<\/u><\/h4>\n\n\n\n<p>The time to complete the process will vary because Ruby is single threaded.<\/p>\n\n\n\n<p>An additional note for this script is that I am using the <a href=\"https:\/\/github.com\/lloyd\/yajl\">YAJL<\/a> parser instead of the default JSON module\u00a0which doesn&#8217;t handle streaming data into Couchbase.<\/p>\n\n\n\n<p>The script below shows the only change required. This will improve memory use during conversion. If you haven&#8217;t installed YAJL before you can simply\u00a0do this: <em>&#8216;gem install yajl-ruby&#8217;<\/em><\/p>\n\n\n<p>[crayon lang=&#8221;ruby&#8221;]#!\/usr\/bin\/env ruby<br \/>\nrequire &#8216;rubygems&#8217;<br \/>\nrequire &#8216;csv&#8217;<br \/>\nrequire &#8216;pathname&#8217;<br \/>\n#require &#8216;JSON&#8217;<br \/>\nrequire &#8216;yajl\/json_gem&#8217;<\/p>\n<p>Dir[&#8220;.\/**\/*.csv&#8221;].each do |csv_file_path|<\/p>\n<p>  puts csv_file_path<br \/>\n  file_name = Pathname.new(csv_file_path).basename(&#8220;.csv&#8221;).to_s<\/p>\n<p>  File.open(&#8220;#{file_name}.json&#8221;,&#8217;w&#8217;) do |json_file|<\/p>\n<p>  jsonData = CSV.read(csv_file_path,<br \/>\n     :headers => true, :header_converters => :symbol).map{|csv_row| csv_row.to_hash}<\/p>\n<p>    json_file.write(JSON.pretty_generate(jsonData));<br \/>\n  end<br \/>\nend<br \/>\n[\/crayon]<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Post Conversion Steps<\/h3>\n\n\n\n<p>Once conversion is completed it is time to compress the file with ZIP:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u00a0Austins-MBP:complaintstemp austin$ ls\r\nConsumer_Complaints.csv        Consumer_Complaints.json    csv2json.rb\r\n \r\nAustins-MBP:complaintstemp austin$ zip Consumer_Complaints.zip Consumer_Complaints.json\r\n  adding: Consumer_Complaints.json (deflated 95%)<\/code><\/pre>\n\n\n\n<p>Place the zip file(s) into a directory. I used <em>~\/Downloads\/json_files\/<\/em> in my home directory.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Austins-MBP:complaintstemp austin$ cp Consumer_Complaints.zip ~\/Downloads\/json_files\/<\/code><\/pre>\n\n\n\n<p>Once data has been prepared you are ready to start loading.\u00a0The following examples will touch on a couple of common ways to get your data into Couchbase in bulk.<\/p>\n\n\n\n<p>The Couchbase install comes with a built-in tool called <strong><em>cbcdocloader<\/em><\/strong>. It takes individual document files, up to 20MB in size, either zipped up or within a directory and loads them. At the time of this writing <em><strong>cbcdocloader<\/strong><\/em>\u00a0requires multiple JSON formated files contained in a directory. Second,\u00a0I will discuss a tool I wrote in Ruby which employs Couchbase&#8217;s own\u00a0Sergey Asavayev&#8217;s <a href=\"https:\/\/github.com\/avsej\/yaji\">YAJI<\/a> Ruby Gem. The code referenced is free to use and can be rewritten in any language you are comfortable using.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong><u>Doc Loading Method 1: Using <em>cbcdocloader<\/em><\/u><\/strong><\/h4>\n\n\n\n<p>Using a set of individual files within a directory, this is a common use case but depends on the structure of the files and directories to be imported to reflect desire documents as they will appear once loaded. To assist in preserving that structure we recommend packaging the files and directories to be loaded within a .zip file.<\/p>\n\n\n\n<p><u>The document ID key names will be based off the document files provided.<\/u><\/p>\n\n\n\n<p><strong><em>Note:\u00a0<\/em><\/strong><em>t<\/em><em>his method is not ideal for large consolidated document files. For large monolithic files\u00a0I will exemplify how they are loaded\u00a0in Method 2, below.<\/em><\/p>\n\n\n\n<p>Then load the file or files by the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cbdocloader -u Administrator -p s3kre7Pa55 -b MyBucketToLoad -n 127.0.0.1:8091 -s 1000 \r\n~\/json_files\/beer-sample.zip\r\n<\/code><\/pre>\n\n\n\n<p><strong>Note<\/strong>:<br>\nThe &#8216;-s 1000&#8217; is the memory size for the bucket. You&#8217;ll need to adjust this value for your bucket.<br>\nAlso the bucket does not need to exist as <em>cbcdocloader<\/em> will create it but be aware of your resource utilization prior to setting the &#8216;-s&#8217; flag to make sure you have available RAM.<\/p>\n\n\n\n<p>If everything was successful you&#8217;ll see output stating if documents were loaded, how many bytes, etc.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\r\nbucket: 2014-10-02-ny-json.zip, msgs transferred...\r\n       :                total |       last |    per sec\r\n byte  :            242446488 |  242446488 |  3115728.2\r\n<\/code><\/pre>\n\n\n\n<p>Here is a brief script to load up a lot of .zip files in a given directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\r\nJSON_Dir=~\/json_files\/\r\nfor ZipFile in $JSON_Dir\/*.zip ; \r\ndo \/Applications\/Couchbase Server.app\/Contents\/Resources\/couchbase-core\/bin\/cbdocloader  \r\n    -u Administrator -p s3kre7Pa55 -b MyBucketToLoad                                  \r\n    -n 127.0.0.1:8091 -s 1000 $ZipFile\r\n done\r\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Doc Loading Method 2: streamloadjson<\/h4>\n\n\n\n<p>The other method is to load all documents, comma separated, from a single monolithic file.<\/p>\n\n\n\n<p>In order to accomplish this method I have prepared a small but effective script that uses the YAJI JSON stream parser and I called it <em>streamjsonload<\/em>.<\/p>\n\n\n\n<p>The options for this program are:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ ruby streamloadjson.rb -h\r\nruby json loader\r\n    -f, --jsonfile jsonfile          JSON formatted filename\r\n    -b, --bucketname BUCKETNAME      bucket name\r\n    -n, --hostname hostname          hostname\/ip address\r\n    -r, --root JSONroot              JSON root to parse\r\n    -d, --docid SearchKey            JSON Key ID\r\n    -h, --help                       This menu<\/code><\/pre>\n\n\n\n<p>To load documents with a test JSON file such as fathers.json.txt from below, it can be called like so:<\/p>\n\n\n<p>[crayon lang=&#8221;ruby&#8221;]ruby streamloadjson.rb -b TestBucket -f fathers.json -n localhost -d id -r \/fathers\/[\/crayon]<\/p>\n\n\n\n<p>The script should provide output like below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Reading from fathers.json\r\nJSON path processed is \/fathers\/\r\nCouchbase  node is localhost\r\n29999 Time: 00:00:07 |&gt;&gt;---=---=---=---=---| Doc Loading<\/code><\/pre>\n\n\n\n<p>One major advantage to using the YAJI parser is that it requires\u00a0very low memory consumption. This means you could potentially paginate the input data and break it up into multiple streams to load into couchbase. It will spawn discreet processes since Ruby is single threaded but another language could also be used for multi-threading. An example of these are on Couchbase Labs Github repository.<\/p>\n\n\n\n<p><strong>A couple of things to note, <\/strong>This tool only loads monolithic document files, will try to create an ID automatically if one isn&#8217;t provided with &#8216;-d&#8217; and will require some fine-tuning of the &#8220;root&#8221; with -r if no documents load.<\/p>\n\n\n\n<p>Newer code for the loader is available on my <a href=\"https:\/\/github.com\/agonyou\/cb-examples\/blob\/master\/CB_csv_streamloader\/CB_SDK_streamloadjson.rb\">github repository<\/a>, but I have also provided it in-linebelow:<\/p>\n\n\n<p>[crayon lang=&#8221;ruby&#8221;]#!\/usr\/bin\/env ruby<\/p>\n<p>#An example JSON file for testing is at:<br \/>\n# https:\/\/github.com\/ysharplanguage\/FastJsonParser\/raw\/master\/JsonTest\/TestData\/fathers.json.txt<\/p>\n<p>require &#8216;ruby-progressbar&#8217;<br \/>\nrequire &#8216;rubygems&#8217;<br \/>\nrequire &#8216;couchbase&#8217;<br \/>\nrequire &#8216;yaji&#8217;<br \/>\nrequire &#8216;optparse&#8217;<\/p>\n<p>options = {}<\/p>\n<p>optparse = OptionParser.new do |opts|<br \/>\nopts.banner = &#8216;ruby json loader&#8217;<\/p>\n<p>opts.on(&#8216;-f&#8217;, &#8216;&#8211;jsonfile jsonfile&#8217;, &#8216;JSON formatted filename&#8217;) do |jsonfile|<br \/>\noptions[:jsonfile] = jsonfile<br \/>\nend<\/p>\n<p>opts.on(&#8216;-b&#8217;, &#8216;&#8211;bucketname BUCKETNAME&#8217;, &#8216;bucket name&#8217;) do |bucketname|<br \/>\noptions[:bucketname] = bucketname<br \/>\nend<\/p>\n<p>opts.on(&#8216;-n&#8217;, &#8216;&#8211;hostname hostname&#8217;, &#8216;hostname\/ip address&#8217;) do |hostname|<br \/>\noptions[:hostname] = hostname<br \/>\n end<\/p>\n<p>opts.on(&#8216;-r&#8217;, &#8216;&#8211;root JSONroot&#8217;, &#8216;JSON root to parse&#8217;) do |root|<br \/>\noptions[:root] = root<br \/>\n end<\/p>\n<p>opts.on(&#8216;-d&#8217;, &#8216;&#8211;docid SearchKey&#8217;, &#8216;JSON Key ID&#8217;) do |docid|<br \/>\noptions[:docid] = docid<br \/>\n end<\/p>\n<p>opts.on(&#8216;-h&#8217;, &#8216;&#8211;help&#8217;, &#8216;This menu&#8217;) { puts opts; exit}<br \/>\nend<\/p>\n<p>optparse.parse!<\/p>\n<p>json_file = options[:jsonfile]<br \/>\nbucket = options[:bucketname]<br \/>\nhost = options[:hostname]<br \/>\nroot = options[:root]<br \/>\ndocid = options[:docid]<\/p>\n<p>#set some defaults if not passed<br \/>\nunless host<br \/>\n      host=localhost<br \/>\nend<\/p>\n<p>unless root<br \/>\n    root=&#8221;\/&#8221;<br \/>\nend<\/p>\n<p>puts &#8220;Reading from #{json_file}&#8221;<br \/>\nputs &#8220;JSON path processed is #{root}&#8221;<br \/>\nputs &#8220;Couchbase  node is #{host}&#8221;<\/p>\n<p># Connect to couchbase host and bucket provided on the command line<br \/>\nclient = Couchbase.connect(:bucket => bucket, :host => host)<\/p>\n<p>#Create the progressbar<br \/>\nprogressbar=ProgressBar.create(:title => &#8220;Doc Loading&#8221;,<br \/>\n                               :starting_at => 0,<br \/>\n                               :total => nil,<br \/>\n                               :throttle_rate => 0.01,<br \/>\n                               :format => &#8216;%a |%b>>%i| %p%% %t&#8217;,<br \/>\n                               :length => 50)<\/p>\n<p>parser = YAJI::Parser.new(File.open(json_file))<\/p>\n<p>  parser.each(root.to_s).with_index do |doc,i|<br \/>\n  unless docid<br \/>\n     hashinfo=doc.hash.abs<br \/>\n     prikey=&#8221;Doc_#{i}:#{hashinfo}&#8221;<br \/>\n  end<br \/>\nprikey=&#8221;#{docid}:#{doc[&#8220;#{docid}&#8221;]}&#8221;<\/p>\n<p>  client.set(&#8220;#{prikey}&#8221;, doc)<br \/>\n  print(&#8220;rProcessed #{i} Documents&#8221;)<br \/>\n  progressbar.increment<br \/>\n  end<br \/>\nprogressbar.finished?<br \/>\nputs[\/crayon]<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Finishing the Job<\/h3>\n\n\n\n<p>Once data has been loaded login to the Couchbase console and begin working with development views for\u00a0queries\u00a0and indexing.<\/p>\n\n\n\n<p>If you are using <a href=\"https:\/\/www.couchbase.com\/blog\/introducing-developer-preview-for-couchbase-server-4.0\/\">Couchbase Server 4.0 with\u00a0N1QL<\/a> you will want to create a primary index so you can\u00a0explore the Couchbase SQL-like interface immediately and start taking advantage of the power of N1QL query through our SDKs!<\/p>\n\n\n\n<p>Many thanks to the great folks in the Open Source community for providing the YAJL gem and to Sergey Avseyev for the YAJI parser. Sergey is a very knowledgeable Couchbase resource responsible for Ruby SDK work and I would also like to encourage any of you to try our JRuby SDK and provide feedback.<\/p>\n\n\n\n<p><strong>Links<\/strong>:<\/p>\n\n\n\n<p>CB Examples Github &#8211;\u00a0<a href=\"https:\/\/github.com\/agonyou\/cb-examples\/\">https:\/\/github.com\/agonyou\/cb-examples\/<\/a><br>\nYAJI Stream Parser &#8211; <a href=\"https:\/\/github.com\/avsej\/yaji\">https:\/\/github.com\/avsej\/yaji<\/a><br>\nYAJL JSON Gem &#8211; <a href=\"https:\/\/github.com\/brianmario\/yajl-ruby\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/brianmario\/yajl-ruby <\/a><br>\ncsv2json Gem &#8211; <a href=\"https:\/\/rubygems.org\/gems\/csv2json\/\">https:\/\/rubygems.org\/gems\/csv2json\/<\/a><br>\nCouchbase Server 4 with N1QL &#8211; <a href=\"https:\/\/www.couchbase.com\/nosql-databases\/downloads#PreRelease\">https:\/\/www.couchbase.com\/nosql-databases\/downloads<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bulk Loading Documents into\u00a0Couchbase This blog post\u00a0is an example of how one might load data as JSON into Couchbase. For the purpose of this post, data extracted from RDBMS as a CSV will be converted to JSON.\u00a0RDBMS DBAs and Admins familiar with Oracle, SQL server, MySQL, etc are probably looking for a way to experiment [&hellip;]<\/p>\n","protected":false},"author":50,"featured_media":18,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"ppma_author":[150],"class_list":["post-447","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.6 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Bulk Loading Documents into Couchbase - 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\/es\/bulk-loading-documents-into-couchbase\/\" \/>\n<meta property=\"og:locale\" content=\"es_MX\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Converting CSV data to JSON and Bulk Loading Documents into Couchbase\" \/>\n<meta property=\"og:description\" content=\"Bulk Loading Documents into\u00a0Couchbase This blog post\u00a0is an example of how one might load data as JSON into Couchbase. For the purpose of this post, data extracted from RDBMS as a CSV will be converted to JSON.\u00a0RDBMS DBAs and Admins familiar with Oracle, SQL server, MySQL, etc are probably looking for a way to experiment [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/es\/bulk-loading-documents-into-couchbase\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-25T18:20:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Austin Gonyou, Solutions Engineer, 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=\"Austin Gonyou, Solutions Engineer, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/\"},\"author\":{\"name\":\"Austin Gonyou, Solutions Engineer, Couchbase\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/2af7d073b54a8723d45b386488b6c23d\"},\"headline\":\"Converting CSV data to JSON and Bulk Loading Documents into Couchbase\",\"datePublished\":\"2015-11-25T18:20:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/\"},\"wordCount\":1678,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Uncategorized\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/\",\"name\":\"Bulk Loading Documents into Couchbase - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2015-11-25T18:20:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/bulk-loading-documents-into-couchbase\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Converting CSV data to JSON and Bulk Loading Documents into Couchbase\"}]},{\"@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\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"width\":\"1024\",\"height\":\"1024\",\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/2af7d073b54a8723d45b386488b6c23d\",\"name\":\"Austin Gonyou, Solutions Engineer, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d245d5b88af47043c834d9fc35101db4840440c89169a9a6b2460ceec055a7bc?s=96&d=mm&r=ga39ad9071c4f649bd25a834bc382587c\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d245d5b88af47043c834d9fc35101db4840440c89169a9a6b2460ceec055a7bc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d245d5b88af47043c834d9fc35101db4840440c89169a9a6b2460ceec055a7bc?s=96&d=mm&r=g\",\"caption\":\"Austin Gonyou, Solutions Engineer, Couchbase\"},\"description\":\"Austin Gonyou is a Solutions Engineer at Couchbase from past 4 years. Austin brings technical solutions about Couchbase NoSQL Document Database server and mobile conversations facilitated by inside, mid-level, and enterprise sales staff for our prospects and customers.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/es\\\/author\\\/austin-gonyou\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Bulk Loading Documents into Couchbase - 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\/es\/bulk-loading-documents-into-couchbase\/","og_locale":"es_MX","og_type":"article","og_title":"Converting CSV data to JSON and Bulk Loading Documents into Couchbase","og_description":"Bulk Loading Documents into\u00a0Couchbase This blog post\u00a0is an example of how one might load data as JSON into Couchbase. For the purpose of this post, data extracted from RDBMS as a CSV will be converted to JSON.\u00a0RDBMS DBAs and Admins familiar with Oracle, SQL server, MySQL, etc are probably looking for a way to experiment [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/es\/bulk-loading-documents-into-couchbase\/","og_site_name":"The Couchbase Blog","article_published_time":"2015-11-25T18:20:49+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"Austin Gonyou, Solutions Engineer, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Austin Gonyou, Solutions Engineer, Couchbase","Est. reading time":"6 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/"},"author":{"name":"Austin Gonyou, Solutions Engineer, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/2af7d073b54a8723d45b386488b6c23d"},"headline":"Converting CSV data to JSON and Bulk Loading Documents into Couchbase","datePublished":"2015-11-25T18:20:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/"},"wordCount":1678,"commentCount":3,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","articleSection":["Uncategorized"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/","url":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/","name":"Bulk Loading Documents into Couchbase - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","datePublished":"2015-11-25T18:20:49+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/bulk-loading-documents-into-couchbase\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Converting CSV data to JSON and Bulk Loading Documents into Couchbase"}]},{"@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":"es"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","width":"1024","height":"1024","caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/2af7d073b54a8723d45b386488b6c23d","name":"Austin Gonyou, Solutions Engineer, Couchbase","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/secure.gravatar.com\/avatar\/d245d5b88af47043c834d9fc35101db4840440c89169a9a6b2460ceec055a7bc?s=96&d=mm&r=ga39ad9071c4f649bd25a834bc382587c","url":"https:\/\/secure.gravatar.com\/avatar\/d245d5b88af47043c834d9fc35101db4840440c89169a9a6b2460ceec055a7bc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d245d5b88af47043c834d9fc35101db4840440c89169a9a6b2460ceec055a7bc?s=96&d=mm&r=g","caption":"Austin Gonyou, Solutions Engineer, Couchbase"},"description":"Austin Gonyou is a Solutions Engineer at Couchbase from past 4 years. Austin brings technical solutions about Couchbase NoSQL Document Database server and mobile conversations facilitated by inside, mid-level, and enterprise sales staff for our prospects and customers.","url":"https:\/\/www.couchbase.com\/blog\/es\/author\/austin-gonyou\/"}]}},"acf":[],"authors":[{"term_id":150,"user_id":50,"is_guest":0,"slug":"austin-gonyou","display_name":"Austin Gonyou, Solutions Engineer, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/posts\/447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/users\/50"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/comments?post=447"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/posts\/447\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/media\/18"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/media?parent=447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/categories?post=447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/tags?post=447"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/ppma_author?post=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}