{"id":10499,"date":"2021-01-27T08:16:01","date_gmt":"2021-01-27T16:16:01","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=10499"},"modified":"2025-06-13T17:32:23","modified_gmt":"2025-06-14T00:32:23","slug":"query-couchbase-data-structures-with-n1ql-sql-for-json","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/es\/query-couchbase-data-structures-with-n1ql-sql-for-json\/","title":{"rendered":"Estructuras de datos y consultas con Couchbase N1QL (SQL para JSON)"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">En el <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/es\/data-structures-for-nosql-applications-in-couchbase-7-0\/\"><span style=\"font-weight: 400;\">Estructuras de datos para aplicaciones NoSQL<\/span><\/a> puesto,<span style=\"font-weight: 400;\"> utilizamos el acceso simplificado a datos JSON a trav\u00e9s de colecciones nativas, mapas y mucho m\u00e1s. <\/span><span style=\"font-weight: 400;\">Este art\u00edculo muestra c\u00f3mo consultar esos datos utilizando consultas N1QL de alto nivel, el lenguaje basado en SQL para JSON.<\/span><\/p>\n<div id=\"attachment_10151\" style=\"width: 778px\" class=\"wp-caption alignnone\"><a style=\"background-color: initial;\" href=\"https:\/\/www.couchbase.com\/blog\/es\/data-structures-for-nosql-applications-in-couchbase-7-0\/\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-10151\" class=\"wp-image-10151 size-medium_large\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/12\/couchbase_data_structures_cheatsheet-768x413.png\" alt=\"chart of couchbase data structures and examples\" width=\"768\" height=\"413\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/12\/couchbase_data_structures_cheatsheet-768x413.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/12\/couchbase_data_structures_cheatsheet-300x161.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/12\/couchbase_data_structures_cheatsheet-1024x550.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/12\/couchbase_data_structures_cheatsheet-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/12\/couchbase_data_structures_cheatsheet.png 1152w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p id=\"caption-attachment-10151\" class=\"wp-caption-text\">Resumen de tipos de estructuras de datos Couchbase y ejemplos JSON.<\/p><\/div>\n<p><span style=\"font-weight: 400;\">Los desarrolladores pueden centrarse en la gesti\u00f3n de estructuras y tipos de datos b\u00e1sicos utilizando lenguajes de programaci\u00f3n. Mientras tanto, los DBA y los analistas pueden acceder a los mismos datos utilizando un lenguaje de consulta. Couchbase lo hace utilizando m\u00e9todos de indexaci\u00f3n de datos NoSQL y servicios de consulta N1QL.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Las consultas de b\u00fasqueda con el motor de b\u00fasqueda de texto completo de Couchbase tambi\u00e9n son posibles y se cubrir\u00e1n en un futuro post.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">\u00bfQu\u00e9 es la indexaci\u00f3n de bases de datos NoSQL?\u00a0<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">La indexaci\u00f3n examina los datos y determina c\u00f3mo volver a encontrar esos elementos. La indexaci\u00f3n puede aplicarse a documentos JSON, claves\/campos o valores en campos. Las claves de los documentos JSON act\u00faan como los nombres de columna en los sistemas de indexaci\u00f3n de bases de datos tabulares.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">La base de datos gestiona estas colecciones de elementos y valores como \u00edndices que remiten a la fuente. El backend de la base de datos actualiza la indexaci\u00f3n a medida que cambian los documentos mientras se almacenan los datos. Mientras tanto, los administradores de bases de datos pueden optimizar la indexaci\u00f3n para casos de uso espec\u00edficos, como escrituras o consultas de gran volumen.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Mediante el uso de \u00edndices, las consultas N1QL pueden encontrar r\u00e1pidamente valores de campo que coincidan sin necesidad de escanear los datos originales. Este m\u00e9todo tambi\u00e9n se aplica a las estructuras de datos comunes, <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/es\/simplifying-query-index-with-collections\/\"><span style=\"font-weight: 400;\">colecciones y \u00e1mbitos introducidos en <\/span><b>Couchbase 7.0<\/b><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Consulta de estructuras de datos Couchbase con N1QL<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">La consola web de Couchbase es una manera f\u00e1cil de ver documentos de estructura de datos en la base de datos. Observa c\u00f3mo los documentos de estructura de datos son a menudo mucho m\u00e1s simples que los documentos JSON m\u00e1s complejos.<\/span><\/p>\n<div id=\"attachment_10500\" style=\"width: 1392px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-10500\" class=\"size-full wp-image-10500\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/01\/data-structure-doc-preview.png\" alt=\"data structure documents listed in the bucket preview screen\" width=\"1382\" height=\"461\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-doc-preview.png 1382w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-doc-preview-300x100.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-doc-preview-1024x342.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-doc-preview-768x256.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-doc-preview-20x7.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-doc-preview-1320x440.png 1320w\" sizes=\"auto, (max-width: 1382px) 100vw, 1382px\" \/><p id=\"caption-attachment-10500\" class=\"wp-caption-text\">Lista de documentos de estructuras de datos en el bucket<\/p><\/div>\n<p><span style=\"font-weight: 400;\">Para empezar a escribir consultas N1QL, es necesario indexar los datos de la estructura de datos. Como m\u00ednimo, se necesita un \u00edndice primario a nivel de bucket para las operaciones b\u00e1sicas.<\/span><\/p>\n<pre class=\"lang:mysql decode:true\">CREATE PRIMARY INDEX ON `travel-sample`;<\/pre>\n<p><span style=\"font-weight: 400;\">Para los documentos que utilizan las nuevas funciones de colecciones de <\/span><b>Couchbase 7.0<\/b><span style=\"font-weight: 400;\">tambi\u00e9n deben estar indexados.<\/span><\/p>\n<pre class=\"lang:mysql decode:true\">CREATE PRIMARY INDEX ON `travel-sample`.`scope1`.`col1`<\/pre>\n<p><strong>P<\/strong><b>ndices rimarios <\/b>lucha con grandes conjuntos de datos<span style=\"font-weight: 400;\"> pero son excelentes para explorar r\u00e1pidamente peque\u00f1as cantidades de datos. Utilice \u00edndices secundarios globales (GSI) cuando avance hacia la producci\u00f3n en un proyecto de big data.<\/span><\/p>\n<h2>Listado de todos los documentos de datos e identificaciones<\/h2>\n<p><span style=\"font-weight: 400;\">Sin embargo, no siempre es posible una indexaci\u00f3n m\u00e1s espec\u00edfica, ya que las estructuras de datos pueden no tener claves con nombre. <\/span><span style=\"font-weight: 400;\">Por ejemplo, un contador es s\u00f3lo un ID y un valor entero sin nombre de campo. Pero, si tienes un mapa, puedes crear un \u00edndice que tenga como objetivo una clave interna.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Una consulta b\u00e1sica del ID del documento puede devolver todos los documentos y mostrar los nombres de los campos utilizados.<\/span><\/p>\n<pre class=\"lang:mysql decode:true\">SELECT META().id, * FROM `travel-sample`<\/pre>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/01\/data-structure-query-results-n1ql1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10501 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/01\/data-structure-query-results-n1ql1.png\" alt=\"query results showing data structure documents\" width=\"926\" height=\"1050\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql1.png 926w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql1-265x300.png 265w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql1-903x1024.png 903w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql1-768x871.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql1-300x340.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql1-18x20.png 18w\" sizes=\"auto, (max-width: 926px) 100vw, 926px\" \/><\/a><\/p>\n<p><i><span style=\"font-weight: 400;\">Puntuaci\u00f3n actual <\/span><\/i><span style=\"font-weight: 400;\">es un contador b\u00e1sico, mientras que <\/span><i><span style=\"font-weight: 400;\">gameList <\/span><\/i><span style=\"font-weight: 400;\">es una lista\/colecci\u00f3n, etc.<\/span><\/p>\n<h3>Consulta de \u00e1mbitos\/colecciones para estructuras de datos<\/h3>\n<p><span style=\"font-weight: 400;\">Si utiliza \u00e1mbitos y colecciones, a\u00f1\u00e1dalos a la cl\u00e1usula from.<\/span><\/p>\n<pre class=\"lang:mysql decode:true\">SELECT * FROM\u00a0`travel-sample`.`scope1`.`col1`<\/pre>\n<p><span style=\"font-weight: 400;\">Recupera un valor espec\u00edfico de un objeto de estructura de datos con nombre a\u00f1adi\u00e9ndolo a la cl\u00e1usula where.<\/span><\/p>\n<pre class=\"lang:mysql decode:true\">SELECT META().id, * FROM `travel-sample` WHERE META().id = 'currentScore'<\/pre>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/01\/data-structure-query-results-n1ql2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10502 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/01\/data-structure-query-results-n1ql2.png\" alt=\"JSON query results showing a document ID and counter value\" width=\"916\" height=\"263\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql2.png 916w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql2-300x86.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql2-768x221.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql2-20x6.png 20w\" sizes=\"auto, (max-width: 916px) 100vw, 916px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Cuando se especifican nombres de campo (y ning\u00fan ID) la consulta devuelve valores coincidentes en todos los documentos.<\/span><\/p>\n<pre class=\"lang:mysql decode:true\">SELECT name, contact FROM `travel-sample`<\/pre>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/01\/data-structure-query-results-n1ql3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10503 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/01\/data-structure-query-results-n1ql3.png\" alt=\"JSON N1QL query showing records containing specific field names\" width=\"567\" height=\"613\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql3.png 567w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql3-277x300.png 277w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql3-300x324.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/data-structure-query-results-n1ql3-18x20.png 18w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">La consulta devuelve objetos con los campos espec\u00edficos y sus valores. En los resultados anteriores, s\u00f3lo una de las estructuras de datos ten\u00eda el valor <\/span><i><span style=\"font-weight: 400;\">p\u00f3ngase en contacto con <\/span><\/i><span style=\"font-weight: 400;\">campo. Otros dos ten\u00edan un <\/span><i><span style=\"font-weight: 400;\">nombre <\/span><\/i><span style=\"font-weight: 400;\">pero varios objetos en blanco muestran que no hab\u00eda campos coincidentes.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para ser escalables, todas las aplicaciones de consulta deben utilizar tambi\u00e9n \u00edndices secundarios globales (GSI) para campos espec\u00edficos.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Este <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/es\/database-indexing-best-practices\/\"><span style=\"font-weight: 400;\">Mejores pr\u00e1cticas de indexaci\u00f3n de bases de datos<\/span><\/a><span style=\"font-weight: 400;\"> El art\u00edculo cubre m\u00e1s escenarios inform\u00e1ticos utilizados en la ingenier\u00eda de software de big data.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Unirlo todo<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Como puedes ver, consultar documentos y subcomponentes relacionados es muy sencillo usando Couchbase. El uso estrat\u00e9gico de sofisticados m\u00e9todos de indexaci\u00f3n proporciona a\u00fan m\u00e1s formas de acceder a los datos que tus aplicaciones est\u00e1n creando.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Couchbase simplifica dr\u00e1sticamente las arquitecturas de sistemas, permitiendo a los desarrolladores empezar sin mucho trabajo. Estas referencias te ayudar\u00e1n a empezar r\u00e1pidamente.<\/span><\/p>\n<ul>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/es\/data-structures-for-nosql-applications-in-couchbase-7-0\/\"><span style=\"font-weight: 400;\">Estructuras de datos para aplicaciones NoSQL en Couchbase 7.0<\/span><\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/es\/scopes-and-collections-for-modern-multi-tenant-applications-couchbase-7-0\/\">\u00c1mbitos y colecciones para aplicaciones multiusuario<\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/docs.couchbase.com\/python-sdk\/2.5\/datastructures.html\"><span style=\"font-weight: 400;\">API de estructuras de datos de Couchbase<\/span><\/a><span style=\"font-weight: 400;\"> (SDK de Python)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/docs.couchbase.com\/python-sdk\/current\/howtos\/subdocument-operations.html\"><span style=\"font-weight: 400;\">Subdocumento operaciones docs<\/span><\/a><span style=\"font-weight: 400;\"> (SDK de Python)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/www.couchbase.com\/blog\/es\/database-indexing-best-practices\/\"><span style=\"font-weight: 400;\">Mejores pr\u00e1cticas de indexaci\u00f3n de sistemas de bases de datos NoSQL<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/www.couchbase.com\/blog\/es\/full-text-search-indexing-best-practices\/\"><span style=\"font-weight: 400;\">Mejores pr\u00e1cticas de indexaci\u00f3n de b\u00fasquedas de texto completo NoSQL<\/span><\/a><span style=\"font-weight: 400;\">\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/docs.couchbase.com\/server\/current\/fts\/full-text-intro.html\"><span style=\"font-weight: 400;\">Documentaci\u00f3n de b\u00fasqueda de texto completo<\/span><\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>In the Data Structures for NoSQL Applications post, we used simplified JSON data access through native collections, maps, and more. This post demonstrates querying that data using higher-level N1QL queries, the SQL-based language for JSON. Developers can focus on managing [&hellip;]<\/p>","protected":false},"author":75185,"featured_media":10506,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1821,1816,1819,2453,1812,2201],"tags":[1883,1800,1696,1261],"ppma_author":[9163],"class_list":["post-10499","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-architecture","category-couchbase-server","category-data-modeling","category-global-secondary-index","category-n1ql-query","category-tools-sdks","tag-data-modelling","tag-data-structures","tag-indexing","tag-json"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Data Structures &amp; Queries with Couchbase N1QL (SQL for JSON)<\/title>\n<meta name=\"description\" content=\"Access JSON NoSQL data with Couchbase data structures: maps, lists, counters, queues using N1QL\/SQL queries, indexes and efficient SDK calls.\" \/>\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\/query-couchbase-data-structures-with-n1ql-sql-for-json\/\" \/>\n<meta property=\"og:locale\" content=\"es_MX\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Structures &amp; Queries with Couchbase N1QL (SQL for JSON)\" \/>\n<meta property=\"og:description\" content=\"Access JSON NoSQL data with Couchbase data structures: maps, lists, counters, queues using N1QL\/SQL queries, indexes and efficient SDK calls.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/es\/query-couchbase-data-structures-with-n1ql-sql-for-json\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-27T16:16:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T00:32:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/query-indexing-blogbanner.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1575\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Tyler Mitchell - Senior Product Marketing Manager\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@1tylermitchell\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tyler Mitchell - Senior Product Marketing Manager\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/\"},\"author\":{\"name\":\"Tyler Mitchell - Senior Product Marketing Manager\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/684cc0e5c60cd2e4b591db9621494ed0\"},\"headline\":\"Data Structures &#038; Queries with Couchbase N1QL (SQL for JSON)\",\"datePublished\":\"2021-01-27T16:16:01+00:00\",\"dateModified\":\"2025-06-14T00:32:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/\"},\"wordCount\":666,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/query-indexing-blogbanner.jpg\",\"keywords\":[\"data modelling\",\"Data structures\",\"Indexing\",\"JSON\"],\"articleSection\":[\"Couchbase Architecture\",\"Couchbase Server\",\"Data Modeling\",\"Global Secondary Index\",\"SQL++ \/ N1QL Query\",\"Tools &amp; SDKs\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/\",\"name\":\"Data Structures & Queries with Couchbase N1QL (SQL for JSON)\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/query-indexing-blogbanner.jpg\",\"datePublished\":\"2021-01-27T16:16:01+00:00\",\"dateModified\":\"2025-06-14T00:32:23+00:00\",\"description\":\"Access JSON NoSQL data with Couchbase data structures: maps, lists, counters, queues using N1QL\/SQL queries, indexes and efficient SDK calls.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/query-indexing-blogbanner.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/query-indexing-blogbanner.jpg\",\"width\":1575,\"height\":628},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data Structures &#038; Queries with Couchbase N1QL (SQL for JSON)\"}]},{\"@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\/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\/684cc0e5c60cd2e4b591db9621494ed0\",\"name\":\"Tyler Mitchell - Senior Product Marketing Manager\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/d8a7c532bf2b94b7a2fe7a8439aafd75\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ebec3213e756f2e1f7118fcb5722e2cd1484c9256ae34ceb8f77054b986f21ce?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ebec3213e756f2e1f7118fcb5722e2cd1484c9256ae34ceb8f77054b986f21ce?s=96&d=mm&r=g\",\"caption\":\"Tyler Mitchell - Senior Product Marketing Manager\"},\"description\":\"Works as Senior Product Marketing Manager at Couchbase, helping bring knowledge about products into the public limelight while also supporting our field teams with valuable content. His personal passion is all things geospatial, having worked in GIS for half his career. Now AI and Vector Search is top of mind.\",\"sameAs\":[\"https:\/\/linkedin.com\/in\/tylermitchell\",\"https:\/\/x.com\/1tylermitchell\",\"https:\/\/www.youtube.com\/channel\/UCBZFuoiTcg0f3lGSQwLjeTg\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/es\/author\/tylermitchell\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Data Structures & Queries with Couchbase N1QL (SQL for JSON)","description":"Accede a datos JSON NoSQL con estructuras de datos Couchbase: mapas, listas, contadores, colas usando consultas N1QL\/SQL, \u00edndices y llamadas SDK eficientes.","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\/query-couchbase-data-structures-with-n1ql-sql-for-json\/","og_locale":"es_MX","og_type":"article","og_title":"Data Structures & Queries with Couchbase N1QL (SQL for JSON)","og_description":"Access JSON NoSQL data with Couchbase data structures: maps, lists, counters, queues using N1QL\/SQL queries, indexes and efficient SDK calls.","og_url":"https:\/\/www.couchbase.com\/blog\/es\/query-couchbase-data-structures-with-n1ql-sql-for-json\/","og_site_name":"The Couchbase Blog","article_published_time":"2021-01-27T16:16:01+00:00","article_modified_time":"2025-06-14T00:32:23+00:00","og_image":[{"width":1575,"height":628,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/query-indexing-blogbanner.jpg","type":"image\/jpeg"}],"author":"Tyler Mitchell - Senior Product Marketing Manager","twitter_card":"summary_large_image","twitter_creator":"@1tylermitchell","twitter_misc":{"Written by":"Tyler Mitchell - Senior Product Marketing Manager","Est. reading time":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/"},"author":{"name":"Tyler Mitchell - Senior Product Marketing Manager","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/684cc0e5c60cd2e4b591db9621494ed0"},"headline":"Data Structures &#038; Queries with Couchbase N1QL (SQL for JSON)","datePublished":"2021-01-27T16:16:01+00:00","dateModified":"2025-06-14T00:32:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/"},"wordCount":666,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/query-indexing-blogbanner.jpg","keywords":["data modelling","Data structures","Indexing","JSON"],"articleSection":["Couchbase Architecture","Couchbase Server","Data Modeling","Global Secondary Index","SQL++ \/ N1QL Query","Tools &amp; SDKs"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/","url":"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/","name":"Data Structures & Queries with Couchbase N1QL (SQL for JSON)","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/query-indexing-blogbanner.jpg","datePublished":"2021-01-27T16:16:01+00:00","dateModified":"2025-06-14T00:32:23+00:00","description":"Accede a datos JSON NoSQL con estructuras de datos Couchbase: mapas, listas, contadores, colas usando consultas N1QL\/SQL, \u00edndices y llamadas SDK eficientes.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/query-indexing-blogbanner.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/01\/query-indexing-blogbanner.jpg","width":1575,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/query-couchbase-data-structures-with-n1ql-sql-for-json\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Data Structures &#038; Queries with Couchbase N1QL (SQL for JSON)"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"El blog de Couchbase","description":"Couchbase, la base de datos 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":"es"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"El blog de Couchbase","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\/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\/684cc0e5c60cd2e4b591db9621494ed0","name":"Tyler Mitchell - Director de Marketing de Producto","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/d8a7c532bf2b94b7a2fe7a8439aafd75","url":"https:\/\/secure.gravatar.com\/avatar\/ebec3213e756f2e1f7118fcb5722e2cd1484c9256ae34ceb8f77054b986f21ce?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ebec3213e756f2e1f7118fcb5722e2cd1484c9256ae34ceb8f77054b986f21ce?s=96&d=mm&r=g","caption":"Tyler Mitchell - Senior Product Marketing Manager"},"description":"Trabaja como Gerente Senior de Marketing de Producto en Couchbase, ayudando a llevar el conocimiento sobre los productos a la luz p\u00fablica, mientras que tambi\u00e9n apoya a nuestros equipos de campo con contenido valioso. Su pasi\u00f3n personal es todo lo geoespacial, habiendo trabajado en GIS durante la mitad de su carrera. Ahora la IA y la b\u00fasqueda vectorial son lo primero en lo que piensa.","sameAs":["https:\/\/linkedin.com\/in\/tylermitchell","https:\/\/x.com\/1tylermitchell","https:\/\/www.youtube.com\/channel\/UCBZFuoiTcg0f3lGSQwLjeTg"],"url":"https:\/\/www.couchbase.com\/blog\/es\/author\/tylermitchell\/"}]}},"authors":[{"term_id":9163,"user_id":75185,"is_guest":0,"slug":"tylermitchell","display_name":"Tyler Mitchell - Senior Product Marketing Manager","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/876da1e4284f1832c871b3514caf7867357744b8c0a370ef6f53a79dee2f379e?s=96&d=mm&r=g","author_category":"","last_name":"Mitchell - Senior Product Marketing Manager","first_name":"Tyler","job_title":"Senior Product Marketing Manager","user_url":"","description":"Trabaja como Gerente Senior de Marketing de Producto en Couchbase, ayudando a llevar el conocimiento sobre los productos a la luz p\u00fablica, mientras que tambi\u00e9n apoya a nuestros equipos de campo con contenido valioso. Su pasi\u00f3n personal es todo lo geoespacial, habiendo trabajado en GIS durante la mitad de su carrera. Ahora la IA y la b\u00fasqueda vectorial son lo primero en lo que piensa."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/posts\/10499","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\/75185"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/comments?post=10499"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/posts\/10499\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/media\/10506"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/media?parent=10499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/categories?post=10499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/tags?post=10499"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/ppma_author?post=10499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}