{"id":1726,"date":"2015-07-14T18:03:59","date_gmt":"2015-07-14T18:03:59","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=1726"},"modified":"2015-07-14T18:03:59","modified_gmt":"2015-07-14T18:03:59","slug":"nodejs-odm-couchbase-ottoman","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/nodejs-odm-couchbase-ottoman\/","title":{"rendered":"Node.js ODM para Couchbase (Otomano)"},"content":{"rendered":"<p>H\u00e1 alguns meses, eu estava conversando com alguns dos usu\u00e1rios do nosso cliente Node.js e ouvi uma opini\u00e3o bastante comum de que as pessoas estavam procurando algum m\u00e9todo para simplificar ainda mais sua vida ao usar o Couchbase a partir do Node.js.  Uma coisa espec\u00edfica que ouvi muito foi que eles estavam procurando uma maneira de ter modelos gerados automaticamente para evitar a necessidade de construir manualmente todo o boilerplate.<\/p>\n<p>Em resposta a isso, comecei a trabalhar em uma nova biblioteca conhecida como Ottoman.  Ottoman \u00e9 um ODM experimental projetado com base no Couchbase.   Neste momento, acho que o Ottoman \u00e9 suficientemente rico em recursos para que alguns olhos externos comecem a dar uma olhada.  Sei que h\u00e1 bugs escondidos no c\u00f3digo-fonte e recursos que podem ser aprimorados, mas gostaria da sua ajuda para fazer isso!  Voc\u00ea \u00e9 quem tem a melhor ideia do que deseja ver e do que seria mais ben\u00e9fico para VOC\u00ca, portanto, quero ouvi-lo com o m\u00e1ximo de perguntas, coment\u00e1rios e\/ou preocupa\u00e7\u00f5es que possa ter.<\/p>\n<p>Vamos \u00e0s explica\u00e7\u00f5es!\u00a0<\/p>\n<p>O objetivo da biblioteca \u00e9 permitir que voc\u00ea crie uma defini\u00e7\u00e3o de como seria o seu modelo e, em seguida, fazer com que ela gere automaticamente todo o boilerplate que normalmente acompanha esse modelo.  Como exemplo, d\u00ea uma olhada no seguinte:<\/p>\n<div class=\"geshifilter\">\n<div class=\"javascript geshifilter-javascript\" style=\"font-family:monospace;\"><span style=\"color: #003366; font-weight: bold;\">var<\/span> Usu\u00e1rio <span style=\"color: #339933;\">=<\/span> Otomana.<span style=\"color: #660066;\">modelo<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #3366CC;\">'Usu\u00e1rio'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 <span style=\"color: #3366CC;\">'nome de usu\u00e1rio'<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">'string'<\/span><span style=\"color: #339933;\">,<\/span><br \/>\u00a0 <span style=\"color: #3366CC;\">\"nome<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">'string'<\/span><span style=\"color: #339933;\">,<\/span><br \/>\u00a0 <span style=\"color: #3366CC;\">'email'<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">'string'<\/span><br \/><span style=\"color: #009900;\">}<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 balde<span style=\"color: #339933;\">:<\/span> <span style=\"color: #003366; font-weight: bold;\">novo<\/span> couchbase.<span style=\"color: #660066;\">Conex\u00e3o<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #009900;\">{<\/span><span style=\"color: #009900;\">}<\/span><span style=\"color: #009900;\">)<\/span><br \/><span style=\"color: #009900;\">}<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span><\/div>\n<\/div>\n<p>This example shows how to create a simple User model, which contains 5 fields (yes 5, I will explain this below).\u00a0 It intuitively contains a 3 string fields, which are username, name and email.\u00a0 Additionally, there are 2 `hidden` fields which are added on and which can be overridden.\u00a0 These fields are the _type and _id fields, which contain a string of what model this document is, as well as a uniquely identifying string, which defaults to using a UUIDv4 uuid.<\/p>\n<p>Usar esse modelo rec\u00e9m-criado \u00e9 extremamente simples, pois o objeto de retorno da fun\u00e7\u00e3o de modelo \u00e9 uma fun\u00e7\u00e3o que pode ser usada para instanciar novas inst\u00e2ncias do modelo.  Portanto, seguindo o exemplo acima, podemos criar e salvar um novo usu\u00e1rio com o seguinte:<\/p>\n<div class=\"geshifilter\">\n<div class=\"javascript geshifilter-javascript\" style=\"font-family:monospace;\"><span style=\"color: #003366; font-weight: bold;\">var<\/span> teste <span style=\"color: #339933;\">=<\/span> <span style=\"color: #003366; font-weight: bold;\">novo<\/span> Usu\u00e1rio<span style=\"color: #009900;\">(<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span><br \/>teste.<span style=\"color: #660066;\">nome de usu\u00e1rio<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #3366CC;\">'brett19'<\/span><span style=\"color: #339933;\">;<\/span><br \/>teste.<span style=\"color: #000066;\">nome<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #3366CC;\">'Brett Lawson'<\/span><span style=\"color: #339933;\">;<\/span><br \/>teste.<span style=\"color: #660066;\">e-mail<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #3366CC;\">&#8216;brett19@gmail.com&#8217;<\/span><span style=\"color: #339933;\">;<\/span><\/p>\n<p>Otomana.<span style=\"color: #660066;\">salvar<\/span><span style=\"color: #009900;\">(<\/span>teste<span style=\"color: #339933;\">,<\/span> <span style=\"color: #003366; font-weight: bold;\">fun\u00e7\u00e3o<\/span><span style=\"color: #009900;\">(<\/span>erro<span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 <span style=\"color: #000066; font-weight: bold;\">se<\/span> <span style=\"color: #009900;\">(<\/span>erro<span style=\"color: #009900;\">)<\/span> <span style=\"color: #000066; font-weight: bold;\">lan\u00e7ar<\/span> erro<span style=\"color: #339933;\">;<\/span><br \/>\u00a0 console.<span style=\"color: #660066;\">registro<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #3366CC;\">'salvos'<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span><br \/><span style=\"color: #009900;\">}<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span><\/div>\n<\/div>\n<p>Al\u00e9m disso, o Ottoman permite que voc\u00ea carregue rapidamente um objeto que foi armazenado anteriormente no banco de dados usando tamb\u00e9m findById, como este:<\/p>\n<div class=\"geshifilter\">\n<div class=\"javascript geshifilter-javascript\" style=\"font-family:monospace;\">Usu\u00e1rio.<span style=\"color: #660066;\">findById<\/span><span style=\"color: #009900;\">(<\/span>teste._id<span style=\"color: #339933;\">,<\/span> <span style=\"color: #003366; font-weight: bold;\">fun\u00e7\u00e3o<\/span><span style=\"color: #009900;\">(<\/span>erro<span style=\"color: #339933;\">,<\/span> obj<span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 <span style=\"color: #000066; font-weight: bold;\">se<\/span> <span style=\"color: #009900;\">(<\/span>erro<span style=\"color: #009900;\">)<\/span> <span style=\"color: #000066; font-weight: bold;\">lan\u00e7ar<\/span> erro<span style=\"color: #339933;\">;<\/span><\/p>\n<p>\u00a0 console.<span style=\"color: #660066;\">registro<\/span><span style=\"color: #009900;\">(<\/span>obj.<span style=\"color: #000066;\">nome<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span><br \/>\u00a0 <span style=\"color: #006600; font-style: italic;\">\/\/ Brett Lawson<\/span><br \/><span style=\"color: #009900;\">}<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span><\/div>\n<\/div>\n<p>At\u00e9 agora, basicamente, vimos apenas algumas opera\u00e7\u00f5es simples de carregamento\/armazenamento que o Ottoman pode fazer. Vamos nos aprofundar um pouco mais e ver onde o Ottoman pode realmente ajudar a aumentar nossa produtividade.  Digamos que estamos criando um site de blog e precisamos armazenar uma postagem de blog associada aos usu\u00e1rios.  Vamos criar um modelo que nos permita fazer isso.<\/p>\n<div class=\"geshifilter\">\n<div class=\"javascript geshifilter-javascript\" style=\"font-family:monospace;\"><span style=\"color: #003366; font-weight: bold;\">var<\/span> BlogPost <span style=\"color: #339933;\">=<\/span> Otomana.<span style=\"color: #660066;\">modelo<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #3366CC;\">'Usu\u00e1rio'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 <span style=\"color: #3366CC;\">\"criador<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">'Usu\u00e1rio'<\/span><span style=\"color: #339933;\">,<\/span><br \/>\u00a0 <span style=\"color: #3366CC;\">'t\u00edtulo'<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">'string'<\/span><span style=\"color: #339933;\">,<\/span><br \/>\u00a0 <span style=\"color: #3366CC;\">\"conte\u00fado<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">'string'<\/span><br \/><span style=\"color: #009900;\">}<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 balde<span style=\"color: #339933;\">:<\/span> ...<br \/><span style=\"color: #009900;\">}<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span><\/div>\n<\/div>\n<p>Voc\u00ea pode ver aqui que um dos nossos tipos de campo na verdade se refere ao nosso objeto User criado acima.  Isso nos permite criar um novo BlogPost que se refere a outro documento armazenado em nosso banco de dados.  Voc\u00ea tamb\u00e9m pode configurar um modelo para ser incorporado.  Digamos que queremos armazenar a localiza\u00e7\u00e3o GPS atual do usu\u00e1rio, bem como sua localiza\u00e7\u00e3o GPS quando ele faz uma postagem.  Em vez de ser um documento referenciado normal, os dados ser\u00e3o incorporados diretamente em seus respectivos objetos, mas permanecer\u00e3o como GPSPositions quando forem desserializados.<\/p>\n<div class=\"geshifilter\">\n<div class=\"javascript geshifilter-javascript\" style=\"font-family:monospace;\"><span style=\"color: #003366; font-weight: bold;\">var<\/span> GPSPosi\u00e7\u00e3o <span style=\"color: #339933;\">=<\/span> Otomana.<span style=\"color: #660066;\">modelo<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #3366CC;\">'GPSPosition'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 lat<span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">'n\u00famero'<\/span><span style=\"color: #339933;\">,<\/span><br \/>\u00a0 longo<span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">'n\u00famero'<\/span><br \/><span style=\"color: #009900;\">}<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 incorporar<span style=\"color: #339933;\">:<\/span> <span style=\"color: #003366; font-weight: bold;\">verdadeiro<\/span><br \/><span style=\"color: #009900;\">}<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span><\/div>\n<\/div>\n<p>The last interesting feature I would like to mention today is the ability to automatically generate map\/reduce views that allow you to preform basic lookups for our models.\u00a0 I would like to strongly prefix this by saying this feature is very much experimental and only works for some of the most common use cases.\u00a0 Additionally it has the caveat of needing you go manually call `registerDesignDocs` on the Ottoman object after all your models have been registered as this is the only way to determine model linkages, additionally, regenerating these views on every startup of your app would be horribly inefficient, so I usually do it as a sort of `setup phase` at the moment.<\/p>\n<p>Para levar nosso exemplo de blog ainda mais longe, digamos que precis\u00e1ssemos de uma lista dos posts de blog de nossos usu\u00e1rios.  Normalmente, isso envolveria a cria\u00e7\u00e3o manual de uma exibi\u00e7\u00e3o para extrair essa lista, pesquisando todos os BlogPost na refer\u00eancia do criador para o usu\u00e1rio espec\u00edfico que estamos procurando.   Com o Ottoman, isso \u00e9 muito mais simples.   Podemos simplesmente definir uma consulta nas propriedades do nosso objeto User da seguinte forma:<\/p>\n<div class=\"geshifilter\">\n<div class=\"javascript geshifilter-javascript\" style=\"font-family:monospace;\">\u00a0 \u00a0 \u00a0 consultas<span style=\"color: #339933;\">:<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0 myPosts<span style=\"color: #339933;\">:<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 alvo<span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">'BlogPost'<\/span><span style=\"color: #339933;\">,<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 mapeadoPor<span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">\"criador<\/span><span style=\"color: #339933;\">,<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 classificar<span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">'desc'<\/span><span style=\"color: #339933;\">,<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 limite<span style=\"color: #339933;\">:<\/span> <span style=\"color: #CC0000;\">5<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #009900;\">}<\/span><br \/>\u00a0 \u00a0 \u00a0 <span style=\"color: #009900;\">}<\/span><span style=\"color: #339933;\">,<\/span><\/div>\n<\/div>\n<p>Agora voc\u00ea pode solicitar as postagens feitas por um usu\u00e1rio simplesmente invocando o m\u00e9todo myPosts em qualquer inst\u00e2ncia de usu\u00e1rio, e ser\u00e1 retornada uma lista de objetos BlogPost que foram postados por esse usu\u00e1rio; a localiza\u00e7\u00e3o e a desserializa\u00e7\u00e3o desses objetos s\u00e3o tratadas automaticamente.<\/p>\n<p>H\u00e1 muitos outros recursos suportados pelo Ottoman que n\u00e3o tenho tempo para mostrar hoje, mas se voc\u00ea quiser ver mais ou quiser ajudar a tornar o Ottoman ainda melhor, v\u00e1 at\u00e9 a p\u00e1gina do GitHub aqui: <a href=\"https:\/\/github.com\/couchbaselabs\/node-ottoman\/\">https:\/\/github.com\/couchbaselabs\/node-ottoman\/<\/a> !<\/p>\n<p>Sa\u00fade! Brett<\/p>","protected":false},"excerpt":{"rendered":"<p>A few months back, I was talking with some of the users of our Node.js client and heard a fairly standard opinion that people were looking for some method to simplify their life further when using Couchbase from Node.js.\u00a0 One [&hellip;]<\/p>\n","protected":false},"author":31,"featured_media":13873,"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":[9004],"class_list":["post-1726","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.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Node.js ODM for Couchbase (Ottoman) - 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\/pt\/nodejs-odm-couchbase-ottoman\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Node.js ODM for Couchbase (Ottoman)\" \/>\n<meta property=\"og:description\" content=\"A few months back, I was talking with some of the users of our Node.js client and heard a fairly standard opinion that people were looking for some method to simplify their life further when using Couchbase from Node.js.\u00a0 One [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/nodejs-odm-couchbase-ottoman\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-07-14T18:03:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/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=\"Brett Lawson, Principal Software 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=\"Brett Lawson, Principal Software Engineer, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/\"},\"author\":{\"name\":\"Brett Lawson, Principal Software Engineer, Couchbase\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/5cfc2fbf25776be2a027a474562be02f\"},\"headline\":\"Node.js ODM for Couchbase (Ottoman)\",\"datePublished\":\"2015-07-14T18:03:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/\"},\"wordCount\":923,\"commentCount\":14,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Uncategorized\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/\",\"name\":\"Node.js ODM for Couchbase (Ottoman) - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2015-07-14T18:03:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/nodejs-odm-couchbase-ottoman\\\/#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\\\/nodejs-odm-couchbase-ottoman\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Node.js ODM for Couchbase (Ottoman)\"}]},{\"@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\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@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\\\/5cfc2fbf25776be2a027a474562be02f\",\"name\":\"Brett Lawson, Principal Software Engineer, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6aec1ba24ef7558a248dcde7b7a18b15b06e2885b24b663906a448634066c1c4?s=96&d=mm&r=gee3586f0c112c20e863af447d44dec8f\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6aec1ba24ef7558a248dcde7b7a18b15b06e2885b24b663906a448634066c1c4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6aec1ba24ef7558a248dcde7b7a18b15b06e2885b24b663906a448634066c1c4?s=96&d=mm&r=g\",\"caption\":\"Brett Lawson, Principal Software Engineer, Couchbase\"},\"description\":\"Brett Lawson is a Principal Software Engineer at Couchbase. Brett is responsible for the design and development of the Couchbase Node.js and PHP clients as well as playing a role in the design and development of the C library, libcouchbase.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/pt\\\/author\\\/brett-lawson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Node.js ODM for Couchbase (Ottoman) - 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\/pt\/nodejs-odm-couchbase-ottoman\/","og_locale":"pt_BR","og_type":"article","og_title":"Node.js ODM for Couchbase (Ottoman)","og_description":"A few months back, I was talking with some of the users of our Node.js client and heard a fairly standard opinion that people were looking for some method to simplify their life further when using Couchbase from Node.js.\u00a0 One [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/nodejs-odm-couchbase-ottoman\/","og_site_name":"The Couchbase Blog","article_published_time":"2015-07-14T18:03:59+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"Brett Lawson, Principal Software Engineer, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Brett Lawson, Principal Software Engineer, Couchbase","Est. reading time":"5 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/"},"author":{"name":"Brett Lawson, Principal Software Engineer, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5cfc2fbf25776be2a027a474562be02f"},"headline":"Node.js ODM for Couchbase (Ottoman)","datePublished":"2015-07-14T18:03:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/"},"wordCount":923,"commentCount":14,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","articleSection":["Uncategorized"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/","url":"https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/","name":"Node.js ODM for Couchbase (Ottoman) - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2015-07-14T18:03:59+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/nodejs-odm-couchbase-ottoman\/#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\/nodejs-odm-couchbase-ottoman\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Node.js ODM for Couchbase (Ottoman)"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","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":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@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\/5cfc2fbf25776be2a027a474562be02f","name":"Brett Lawson, engenheiro de software principal, Couchbase","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/secure.gravatar.com\/avatar\/6aec1ba24ef7558a248dcde7b7a18b15b06e2885b24b663906a448634066c1c4?s=96&d=mm&r=gee3586f0c112c20e863af447d44dec8f","url":"https:\/\/secure.gravatar.com\/avatar\/6aec1ba24ef7558a248dcde7b7a18b15b06e2885b24b663906a448634066c1c4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6aec1ba24ef7558a248dcde7b7a18b15b06e2885b24b663906a448634066c1c4?s=96&d=mm&r=g","caption":"Brett Lawson, Principal Software Engineer, Couchbase"},"description":"Brett Lawson \u00e9 engenheiro de software principal da Couchbase. Brett \u00e9 respons\u00e1vel pelo projeto e desenvolvimento dos clientes Node.js e PHP do Couchbase, al\u00e9m de desempenhar um papel no projeto e desenvolvimento da biblioteca C, libcouchbase.","url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/brett-lawson\/"}]}},"acf":[],"authors":[{"term_id":9004,"user_id":31,"is_guest":0,"slug":"brett-lawson","display_name":"Brett Lawson, Principal Software Engineer, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/6aec1ba24ef7558a248dcde7b7a18b15b06e2885b24b663906a448634066c1c4?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/1726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=1726"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/1726\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=1726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=1726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=1726"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=1726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}