

{"id":48113,"date":"2019-01-25T09:20:28","date_gmt":"2019-01-25T03:50:28","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=48113"},"modified":"2021-05-09T13:07:23","modified_gmt":"2021-05-09T07:37:23","slug":"mongodb-relationships","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/","title":{"rendered":"MongoDB Relationships (Embedded &amp; Reference) &#8211; Database References"},"content":{"rendered":"<p>In the last tutorial, we had seen <strong>MongoDB Backup and Restore Options<\/strong>. Now, we will be looking at MongoDB relationships and database reference. In which, we will learn teo different methods of relationship in MongoDB: Embedded and Documented Reference.<\/p>\n<p>So, let&#8217;s start MongoDB Relationships Tutorial.<\/p>\n<h2>Methods to Create MongoDB Relationships<\/h2>\n<p>To create a\u00a0MongoDB relationships, we have to either embed a BSON document within another or reference it from another. In MongoDB, you can create a relationship using the following methods:<\/p>\n<ol>\n<li>Embedded Relationships<\/li>\n<li>Documented Reference Relationships<\/li>\n<\/ol>\n<h3>i. Embedded Relationships in MongoDB<\/h3>\n<p>The benefit of using the above method is performed. If it will be embedded within the documents, queries will run faster than if we spread them on multiple documents. This will provide acceleration in the performance, especially with a large amount of data.<\/p>\n<p>Here, in embedded relationships, we will discuss two types of model:<\/p>\n<ul>\n<li>One-to-one relationship<\/li>\n<li>One-to-many relationship<\/li>\n<\/ul>\n<h4>a. One to One Relationship in MongoDB<\/h4>\n<p>It is where the parent document has one child, and the child has one parent. With the help of an example, we will learn about this one to one relationship.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">db.singers.insert(\r\n  {\r\n     _id : 2,\r\n     artistname : \"XYZ\",\r\n     address : {\r\n                  street : \"Apollo Street\",\r\n                  city : \"Mumbai\",\r\n                  state : \"Maharashtra\",\r\n                  country : \"India\"\r\n                }\r\n    }\r\n)<\/pre>\n<p>After executing the following command we will get the following output:<\/p>\n<p>WriteResult({ &#8220;nInserted&#8221; : 1 })<\/p>\n<h4>b. One to Many Relationships in MongoDB<\/h4>\n<p>It is a MongoDB relationship, in which a parent can have many child documents in it. But child document can have only one parent. We will take an example to understand the following relationship.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">db.singers.insert(\r\n  {\r\n     _id : 3,\r\n     artistname : \"XYZ\",\r\n     albums : [\r\n             {\r\n               album : \"DEF\",\r\n               year : 2000,\r\n               genre : \"Blues\"\r\n               }, \r\n               {\r\n                    album : \"ABC\",\r\n                    year : 2013,\r\n                    genre : \"Classical Music\"\r\n               }\r\n          ]\r\n     }\r\n)<\/pre>\n<p>After executing the following code, we will get the following result:<\/p>\n<p>WriteResult({ &#8220;nInserted&#8221; : 1 })<\/p>\n<h3>ii. Document Referenced Relationships in MongoDB<\/h3>\n<p>Rather than implanting a child document into the parent document, we separate the child and parent document respectively. When data needs to be repeated across many documents, it is helpful to have them in their own separate document.<\/p>\n<p>This reduces error and keeps data consistent. We will take an example to understand this relationship in a better manner.<\/p>\n<h4>a. Parent Document<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">db.singers.insert(\r\n  {\r\n    _id : 4,\r\n    artistname : \"UVW\"\r\n   }\r\n)<\/pre>\n<h4>b. Child Documents<\/h4>\n<p>Here we will add 3 documents.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">db.instruments.insert(\r\n{\r\n    _id : 9,\r\n    singer_name : \"GHI\",\r\n    instrument : [ \"Accordion\", \"Jaw Harps\", \"Keyboards\" ],\r\n    artist_id : 4\r\n  }\r\n)\r\n\r\ndb.instruments.insert(\r\n  {\r\n    _id : 10,\r\n    name : \"ABC\",\r\n    instrument : [ \"Banjo\", \"Cello\" ],\r\n    artist_id : 4\r\n  }\r\n)\r\n\r\ndb.instruments.insert(\r\n {\r\n    _id : 11,\r\n    name : \"LMN\",\r\n    instrument : \"Membranophones\",\r\n    artist_id : 4\r\n  }\r\n)<\/pre>\n<h4>c. Querying the MongoDB Relationships<\/h4>\n<p>After<strong> inserting these documents<\/strong> now we will use $<strong>lookup<\/strong> to perform left outer join on the two collections.<\/p>\n<p>Here, we will use aggregate() method and $match, so that we get the details of artist, and we get the child and parent documents together.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">db.singers.aggregate([\r\n  {\r\n     $lookup:\r\n       {\r\n         from: \"instruments\",\r\n         localField: \"_id\",\r\n         foreignField: \"artist_id\",\r\n         as: \"band_members\"\r\n       }\r\n        },\r\n        { $match : { artistname : \"UVW\" } }\r\n]).pretty()<\/pre>\n<p>After executing the code we will get the following output:<\/p>\n<p>{<br \/>\n&#8220;_id&#8221; : 4,<br \/>\n&#8220;artistname&#8221; : &#8220;UVW&#8221;,<br \/>\n&#8220;band_members&#8221; : [<br \/>\n{<br \/>\n\u201c_id\u201d : 9,<br \/>\n\u201csinger_name\u201d : &#8220;GHI&#8221;,<br \/>\n\u201cinstrument\u201d : [ &#8220;Accordion&#8221;, &#8220;Jaw Harps&#8221;, &#8220;Keyboards&#8221; ],<br \/>\n\u201cartist_id\u201d : 4<br \/>\n},<br \/>\n{<br \/>\n\u201c_id\u201d : 10,<br \/>\nname : &#8220;ABC&#8221;,<br \/>\ninstrument : [ &#8220;Banjo&#8221;, &#8220;Cello&#8221; ],<br \/>\nartist_id : 4<br \/>\n},<br \/>\n{<br \/>\n\u201c_id\u201d : 11,<br \/>\n\u201cname\u201d : &#8220;LMN&#8221;,<br \/>\n\u201cinstrument\u201d : &#8220;Membranophones&#8221;,<br \/>\n\u201cartist_id\u201d : 4<br \/>\n}<br \/>\n]<br \/>\n}<\/p>\n<p>We can see that 2 fields are from singers collection and rest are from instruments <strong>collection<\/strong>.<\/p>\n<h2>MongoDb Database References<\/h2>\n<p>If in some cases our documents contain references from different collection then we have to use database reference at that time. It is also called as DBRefs. The reason why we are using this is that manual references do not convey the database and collection names.<\/p>\n<p>DBRefs are used to represent a document rather than a specific reference type. They include collection name, value from _id field and in some cases database name.<\/p>\n<p>The fields related to DBRefs are as follows:<\/p>\n<ul>\n<li><strong>$ref:<\/strong> It holds the name of collection where the document resides.<\/li>\n<li><strong>$id:<\/strong> It contains the value of _id field in the referenced document.<\/li>\n<li><strong>$db:<\/strong> This field is optional. It contains the name of database where the document resides. There are few drivers which support $db.<\/li>\n<\/ul>\n<p>We will take an example to understand the following fields:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">{ \"$ref\" : &lt;value&gt;, \"$id\" : &lt;value&gt;, \"$db\" : &lt;value&gt; }<\/pre>\n<p>Consider a document from the collection that stored a DBRef in an example field:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">{\r\n\"_id\" : ObjectId(\"5126bbf64aed4daf9e2ab771\"),\r\n\/\/ .. application fields\r\n\"example\" : {\r\n          \"$ref\" : \"creators\",\r\n          \"$id\" : ObjectId(\"5126bc054aed4daf9e2ab772\"),\r\n          \"$db\" : \"users\"\r\n          }\r\n}\r\n<\/pre>\n<h3>i. List of Drivers Supported by DBRefs<\/h3>\n<p>Now we will take a look at the<strong> list of drivers supported by DBRefs<\/strong>:<\/p>\n<ul>\n<li><strong>C:<\/strong> It does not support DBRefs. You will have to traverse manually.<\/li>\n<li><strong>C++ :<\/strong> It does not support DBRefs. You will have to traverse manually.<\/li>\n<li><strong>C#:<\/strong> It supports DBRefs by using<a href=\"https:\/\/api.mongodb.com\/csharp\/current\/html\/T_MongoDB_Driver_MongoDBRef.htm\">\u00a0<strong>https:\/\/api.mongodb.com\/csharp\/current\/html\/T_MongoDB_Driver_MongoDBRef.htm<\/strong>\u00a0<\/a>class and FetchDBRef and FetchDBRefAs methods.<\/li>\n<li><strong>Haskell<\/strong>: It does not support DBRefs. You will have to traverse manually.<\/li>\n<li><strong>Java<\/strong>: The <strong>https:\/\/api.mongodb.com\/java\/current\/com\/mongodb\/DBRef.html<\/strong> class provides support for DBRefs.<\/li>\n<li><strong>JavaScript<\/strong>: The mongo shells Javascript interface provides support.<\/li>\n<li><strong>Node<\/strong>.<strong>js<\/strong>: The <strong>mongodb.github.io\/node-mongodb-native\/api-bson-generated\/db_ref.html<\/strong> class provides support for DBRefs.<\/li>\n<li><strong>Perl<\/strong>: The <strong>https:\/\/metacpan.org\/pod\/MongoDB::DBRef<\/strong> class provides support for DBRefs.<\/li>\n<li><strong>PHP<\/strong>: It does not support DBRefs. You will have to traverse manually.<\/li>\n<li><strong>Python<\/strong>: The <strong>https:\/\/api.mongodb.com\/python\/current\/api\/bson\/dbref.html<\/strong> class provides support for DBRefs.<\/li>\n<li><strong>Ruby<\/strong>: The <strong>https:\/\/api.mongodb.com\/ruby\/current\/BSON\/DBRef.html<\/strong> class provides support for DBRefs.<\/li>\n<li><strong>Scala<\/strong>: It does not support DBRefs. You will have to traverse manually.<\/li>\n<\/ul>\n<p>So, this was all about MongoDB Relationships and Database Reference. Hope, you liked our explanation.<\/p>\n<h2>Summary<\/h2>\n<p>Hence, we have studied MongoDB relationships and database reference. In addition, we have see two different methods to create relationships. At last, we discussed a list of drivers supported by DBRefs.<\/p>\n<p>Still, if you find any query, feel free to ask in the comment box.<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1670,&quot;href&quot;:&quot;https:\\\/\\\/api.mongodb.com\\\/csharp\\\/current\\\/html\\\/T_MongoDB_Driver_MongoDBRef.htm&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20201020145704\\\/https:\\\/\\\/api.mongodb.com\\\/csharp\\\/current\\\/html\\\/T_MongoDB_Driver_MongoDBRef.htm&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 16:24:21&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-01-04 07:04:25&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-01-07 14:22:11&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-01-11 13:43:38&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-23 08:41:38&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-23 04:03:02&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-01 15:07:27&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-08 16:14:11&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-18 08:31:18&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-23 17:11:54&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-29 06:41:31&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-05-07 17:25:55&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-05-12 15:27:22&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-02 15:18:08&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-18 23:05:56&quot;,&quot;http_code&quot;:404}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-18 23:05:56&quot;,&quot;http_code&quot;:404},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the last tutorial, we had seen MongoDB Backup and Restore Options. Now, we will be looking at MongoDB relationships and database reference. In which, we will learn teo different methods of relationship in&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":48125,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[18566,18569,18568,18572,18571,18570,18567],"class_list":["post-48113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mongodb","tag-create-mongodb-relationships","tag-documented-reference-relationships","tag-embedded-relationships","tag-list-of-drivers-supported-by-dbrefs","tag-one-to-many-relationship","tag-one-to-one-relationship","tag-relationships-in-mongodb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MongoDB Relationships (Embedded &amp; Reference) - Database References - DataFlair<\/title>\n<meta name=\"description\" content=\"Two methods to create MongoDB Relationships: Embedded, Documented Reference, One-to-one, One-to-many relationships, Database References with examples\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MongoDB Relationships (Embedded &amp; Reference) - Database References - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Two methods to create MongoDB Relationships: Embedded, Documented Reference, One-to-one, One-to-many relationships, Database References with examples\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-25T03:50:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-09T07:37:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/MongoDB-Relationships-and-Database-References-01.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MongoDB Relationships (Embedded &amp; Reference) - Database References - DataFlair","description":"Two methods to create MongoDB Relationships: Embedded, Documented Reference, One-to-one, One-to-many relationships, Database References with examples","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:\/\/data-flair.training\/blogs\/mongodb-relationships\/","og_locale":"en_US","og_type":"article","og_title":"MongoDB Relationships (Embedded &amp; Reference) - Database References - DataFlair","og_description":"Two methods to create MongoDB Relationships: Embedded, Documented Reference, One-to-one, One-to-many relationships, Database References with examples","og_url":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2019-01-25T03:50:28+00:00","article_modified_time":"2021-05-09T07:37:23+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/MongoDB-Relationships-and-Database-References-01.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"MongoDB Relationships (Embedded &amp; Reference) &#8211; Database References","datePublished":"2019-01-25T03:50:28+00:00","dateModified":"2021-05-09T07:37:23+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/"},"wordCount":847,"commentCount":1,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/MongoDB-Relationships-and-Database-References-01.jpg","keywords":["Create MongoDB Relationships","Documented Reference Relationships","Embedded Relationships","list of drivers supported by DBRefs","One-to-many relationship","One-to-one relationship","Relationships in MongoDB"],"articleSection":["MongoDB Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/mongodb-relationships\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/","url":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/","name":"MongoDB Relationships (Embedded &amp; Reference) - Database References - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/MongoDB-Relationships-and-Database-References-01.jpg","datePublished":"2019-01-25T03:50:28+00:00","dateModified":"2021-05-09T07:37:23+00:00","description":"Two methods to create MongoDB Relationships: Embedded, Documented Reference, One-to-one, One-to-many relationships, Database References with examples","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/mongodb-relationships\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/MongoDB-Relationships-and-Database-References-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/MongoDB-Relationships-and-Database-References-01.jpg","width":1200,"height":628,"caption":"MongoDB Relationships (Embedded &amp; Reference) - Database References"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/mongodb-relationships\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"MongoDB Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/mongodb\/"},{"@type":"ListItem","position":3,"name":"MongoDB Relationships (Embedded &amp; Reference) &#8211; Database References"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/48113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=48113"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/48113\/revisions"}],"predecessor-version":[{"id":92773,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/48113\/revisions\/92773"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/48125"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=48113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=48113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=48113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}