{"id":1047,"date":"2024-07-31T10:17:48","date_gmt":"2024-07-31T08:17:48","guid":{"rendered":"https:\/\/blog.sutilweb.eu\/?page_id=1047"},"modified":"2024-07-31T10:17:48","modified_gmt":"2024-07-31T08:17:48","slug":"13-ejemplo-de-modelado-de-datos-modelo-documental","status":"publish","type":"page","link":"https:\/\/sutilweb.eu\/index.php\/databases\/diseno-de-bases-de-datos\/13-ejemplo-de-modelado-de-datos-modelo-documental\/","title":{"rendered":"13. Ejemplo de modelado de datos: Modelo documental"},"content":{"rendered":"\n<p>Las <strong>entidades<\/strong> son los <strong>objetos<\/strong> de nuestro <strong>modelo de datos.<\/strong> Si decidimos utilizar un <strong>sistema gestor de datos basado en una base de datos relacional<\/strong>, entonces las <strong>entidades<\/strong> se convierten en <strong>tablas.<\/strong> En cambio, si nuestro <strong>modelo de datos<\/strong> lo vamos a dise\u00f1ar en una <strong>base de datos no relacional<\/strong>, hay un tipo de <strong>base de datos no relacional<\/strong> que son de las m\u00e1s populares que son las <strong>documentales,<\/strong> que se llaman as\u00ed porque guardan la informaci\u00f3n de las entidades no en <strong>tablas,<\/strong> sino en <strong>documentos,<\/strong> y un <strong>documento<\/strong> es como si fuera un <strong>objeto JSON<\/strong>. La estructura de un <strong>objeto Javascript<\/strong> es la manera en como se guardan los <strong>documentos<\/strong> en una <strong>base de datos documental<\/strong>.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Aprovechando el ejercicio del cap\u00edtulo anterior, vamos a crear un archivo llamado Carreras_ModeloDocumental.json, que va a tener la siguiente sintaxis.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{\n&nbsp; \"carreras\": [\n&nbsp; &nbsp; {\n&nbsp; &nbsp; &nbsp; \"carrera_id\": \"1\",\n&nbsp; &nbsp; &nbsp; \"nombre\": \"Carrera 1\",\n&nbsp; &nbsp; &nbsp; \"tipo_carrera\": \"10K\",\n&nbsp; &nbsp; &nbsp; \"fecha\": \"2021\",\n&nbsp; &nbsp; &nbsp; \"tiempo\": \"1:00\",\n&nbsp; &nbsp; &nbsp; \"mejor_tiempo\": false,\n&nbsp; &nbsp; &nbsp; \"altitud\": \"2200\",\n&nbsp; &nbsp; &nbsp; \"lugar\": \"Madrid\",\n&nbsp; &nbsp; &nbsp; \"pais\": \"Espa\u00f1a\",\n&nbsp; &nbsp; &nbsp; \"foto\": \"foto1.png\"\n&nbsp; &nbsp; },\n&nbsp; &nbsp; {\n&nbsp; &nbsp; &nbsp; \"carrera_id\": \"\",\n&nbsp; &nbsp; &nbsp; \"nombre\": \"\",\n&nbsp; &nbsp; &nbsp; \"tipo_carrera\": \"\",\n&nbsp; &nbsp; &nbsp; \"fecha\": \"\",\n&nbsp; &nbsp; &nbsp; \"tiempo\": \"\",\n&nbsp; &nbsp; &nbsp; \"altitud\": \"\",\n&nbsp; &nbsp; &nbsp; \"lugar\": \"\",\n&nbsp; &nbsp; &nbsp; \"pais\": \"\",\n&nbsp; &nbsp; &nbsp; \"foto\": \"\"\n&nbsp; &nbsp; },\n&nbsp; &nbsp; {\n&nbsp; &nbsp; &nbsp; \"carrera_id\": \"\",\n&nbsp; &nbsp; &nbsp; \"nombre\": \"\",\n&nbsp; &nbsp; &nbsp; \"tipo_carrera\": \"\",\n&nbsp; &nbsp; &nbsp; \"fecha\": \"\",\n&nbsp; &nbsp; &nbsp; \"tiempo\": \"\",\n&nbsp; &nbsp; &nbsp; \"altitud\": \"\",\n&nbsp; &nbsp; &nbsp; \"lugar\": \"\",\n&nbsp; &nbsp; &nbsp; \"pais\": \"\",\n&nbsp; &nbsp; &nbsp; \"foto\": \"\"\n&nbsp; &nbsp; }\n&nbsp; ]\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Las entidades son los objetos de nuestro modelo de datos. Si decidimos utilizar un sistema gestor de datos basado en [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1009,"menu_order":12,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-1047","page","type-page","status-publish","hentry"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Sutil Web","author_link":"https:\/\/sutilweb.eu\/index.php\/author\/sutilweb\/"},"uagb_comment_info":0,"uagb_excerpt":"Las entidades son los objetos de nuestro modelo de datos. Si decidimos utilizar un sistema gestor de datos basado en [&hellip;]","_links":{"self":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/comments?post=1047"}],"version-history":[{"count":2,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1047\/revisions"}],"predecessor-version":[{"id":1049,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1047\/revisions\/1049"}],"up":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1009"}],"wp:attachment":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/media?parent=1047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}