{"id":2215,"date":"2018-06-11T20:07:29","date_gmt":"2018-06-11T20:07:29","guid":{"rendered":"https:\/\/ionicframework.com\/?p=2215"},"modified":"2020-10-15T22:55:17","modified_gmt":"2020-10-15T22:55:17","slug":"building-ionic-apps-with-firestore","status":"publish","type":"post","link":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore","title":{"rendered":"Building Ionic Apps with Firestore"},"content":{"rendered":"<blockquote><p>\n  This is a guest post from Jorge Vegara. Check out his courses covering Ionic, PWAs, and Firebase over at <a href=\"https:\/\/jsmobiledev.com\">https:\/\/jsmobiledev.com<\/a>.\n<\/p><\/blockquote>\n<p>Firestore is a fully managed NoSQL document-based database for mobile and web. It&#8217;s designed to store and sync app data easily. Today, we&#8217;ll go over how to manage data from an Ionic app, using <a href=\"https:\/\/firebase.google.com\/docs\/firestore\/\" rel=\"noopener\" target=\"_blank\">Firestore<\/a>.<\/p>\n<p><!--more--><\/p>\n<h2>What is a Document-oriented database?<\/h2>\n<p>Before we jump into things, we need to know how to use it and how it differs from the real-time database.<\/p>\n<p>FireStore is a NoSQL document-oriented database. It&#8217;s a big difference from the Real-time database (<em>referred to as RTDB from now on<\/em>) which is also NoSQL. The RTDB is a gigantic JSON tree where anything goes, and you can set up the information however you want. Simply put, the RTDB let&#8217;s developers put what ever data they want, where ever they want.<\/p>\n<p>Firestore, however, is a document-oriented database that offers much more structure than the RTDB. All of your data is stored in objects called documents and these documents can have any number of entries inside (<em>booleans, strings, or even other objects<\/em>). When grouped together, documents are referred to as <strong>collections<\/strong>.<\/p>\n<p>For example, let&#8217;s imagine we want to store user information in the database: We would create a collection called <code>users<\/code>. Inside the collection we&#8217;d find objects that hold the information to each user&#8217;s profile. Those user profiles are the documents in our database.<\/p>\n<p>A crucial thing to note is that documents can&#8217;t have other documents stored inside of them. For example, the user <code>javebratt<\/code> can&#8217;t have a user of <code>booya<\/code> as one of its properties. But documents can store other sub-collections inside. For example, the user <code>javebratt<\/code> can have a collection of <code>tasks<\/code> as one of its properties, and that sub-collection can hold all of the tasks documents.<\/p>\n<h2>Setup and Configuration<\/h2>\n<p>Now that we have some more insight as to what Firestore is, let&#8217;s install it into our Ionic app. The first thing we&#8217;ll need to do is install the Firebase SDK.<br \/>\nWe could install just the Firebase JS SDK, but since we&#8217;re using Angular, we&#8217;ll install AngularFire2 as it gives us a nice Observable-based API to work with.<\/p>\n<p>Open your terminal, navigate to your app&#8217;s directory and run:<\/p>\n<pre><code class=\"language-bash\">$ npm install angularfire2 firebase --save\n<\/code><\/pre>\n<p>After installed, we need to initialize Firebase. For that go to <code>src\/app\/app.module.ts<\/code> and import everything we&#8217;ll need:<\/p>\n<pre><code class=\"language-typescript\">import { AngularFireModule } from &#039;angularfire2&#039;;\nimport { AngularFirestoreModule } from &#039;angularfire2\/firestore&#039;;\nimport { firebaseConfig } from &#039;.\/credentials&#039;;\n<\/code><\/pre>\n<p>The AngularFire modules are so that we can access firestore, and the <code>firebaseConfig<\/code> module is a file we&#8217;re using to keep our credentials out of source control.<\/p>\n<p>All you need to do is create the file <code>src\/app\/credentials.ts<\/code> and populate it with:<\/p>\n<pre><code class=\"language-typescript\">export const firebaseConfig = {\n  apiKey: &#039;Your Firebase Credentials Here&#039;,\n  authDomain: &#039;Your Firebase Credentials Here&#039;,\n  databaseURL: &#039;Your Firebase Credentials Here&#039;,\n  projectId: &#039;Your Firebase Credentials Here&#039;,\n  storageBucket: &#039;Your Firebase Credentials Here&#039;,\n  messagingSenderId: &#039;Your Firebase Credentials Here&#039;\n};\n<\/code><\/pre>\n<p>These credentials are available inside your Firebase Console.<\/p>\n<blockquote><p>\n  By the way, while you&#8217;re in the Firebase Console, go into the <strong>Database Tab<\/strong> and select <strong>Cloud Firestore<\/strong>. Tell it to allow read\/write since we&#8217;re going to be in development. Keep in mind that you need to set up proper security rules before going to production.\n<\/p><\/blockquote>\n<p>Once we import everything, add it to the <code>imports<\/code> array inside the <code>@NgModule<\/code> declaration:<\/p>\n<pre><code class=\"language-typescript\">@NgModule({\n  declarations: [...],\n  imports: [\n    BrowserModule,\n    IonicModule.forRoot(MyApp),\n    AngularFireModule.initializeApp(firebaseConfig),\n    AngularFirestoreModule\n  ],\n  bootstrap: [...],\n  entryComponents: [...],\n  providers: [...]\n})\n<\/code><\/pre>\n<p>Now that we got the setup work done, we can access our database inside the app.<\/p>\n<h2>Reading Data from FireStore<\/h2>\n<p>To read data from the database, we have two options: We can either (1) get a collection of items (<em>think of it as an array of object<\/em>), or (2) get a specific document from the database (<em>a single object<\/em>).<\/p>\n<p>To read an object from the database, all you need to do is to create a reference pointing to that document:<\/p>\n<pre><code class=\"language-javascript\">constructor(private fireStore: AngularFirestore) {\n  this.userDoc = fireStore.doc&lt;any&gt;(&#039;userProfile\/we45tfgy8ij&#039;);\n}\n<\/code><\/pre>\n<p>Then in our HTML:<\/p>\n<pre><code class=\"language-html\">&lt;ion-content&gt;\n &lt;pre&gt;{{userDoc | json | async}}&lt;\/pre&gt;\n&lt;\/ion-content&gt;\n<\/code><\/pre>\n<blockquote><p>\n  The <code>async<\/code> pipe here is a special pipe in Angular that will automatically handle subscribing and unsubscribing from an observable when the component is created and destroyed.\n<\/p><\/blockquote>\n<p>In our example, we&#8217;re pointing to the document with the ID of <code>we45tfgy8ij<\/code> inside the <code>userProfile<\/code> collection. If you want to fetch the entire user collection, we could do:<\/p>\n<pre><code class=\"language-javascript\">constructor(private fireStore: AngularFirestore) {\n  this.userProfileCollection = fireStore.collection&lt;any&gt;(&#039;userProfile&#039;);\n}\n<\/code><\/pre>\n<p>You can also query users based on specific properties. Let&#8217;s say our users have a property called <code>teamAdmin<\/code> and we want to fetch the profiles of all the users who are admins of a team.<\/p>\n<pre><code class=\"language-javascript\">constructor(private fireStore: AngularFirestore) {\n  this.teamAdminCollection = fireStore.collection&lt;any&gt;(&#039;userProfile&#039;, ref =&gt;\n    ref.where(&#039;teamAdmin&#039;, &#039;==&#039;, true));\n}\n<\/code><\/pre>\n<h2>Adding data to FireStore<\/h2>\n<p>We are however getting a little be ahead of ourselves, as we first need data in database before we can read.<br \/>\nTo push objects to the database we have two main options.<\/p>\n<p>If we want to have a specific ID for the documented we can do:<\/p>\n<pre><code class=\"language-javascript\">constructor(private fireStore: AngularFirestore) {\n  this.userDoc = fireStore.doc&lt;any&gt;(&#039;userProfile\/we45tfgy8ij&#039;);\n  this.userDoc.set({\n    name: &#039;Jorge Vergara&#039;,\n    email: &#039;j@javebratt.com&#039;,\n    \/\/ Other info you want to add here\n  })\n}\n<\/code><\/pre>\n<p>If we don&#8217;t care about ID, we can just push the documents to the collection and let Firebase auto-generate the ID for us.<\/p>\n<pre><code class=\"language-javascript\">constructor(private fireStore: AngularFirestore) {\n  this.userProfileCollection = fireStore.collection&lt;any&gt;(&#039;userProfile&#039;);\n\n  this.userProfileCollection.push({\n    name: &#039;Jorge Vergara&#039;,\n    email: &#039;j@javebratt.com&#039;,\n    \/\/ Other info you want to add here\n  });\n}\n<\/code><\/pre>\n<h2>Updating data from FireStore<\/h2>\n<p>So far we&#8217;ve seen that the database API is fairly approachable for new devs and seasoned pros.<br \/>\nTo read data, we grab a reference to a collection or document.<br \/>\nTo write data, we call <code>set()<\/code> and pass the data we want to write.<br \/>\nNow can you guess what the method is going to be called to update existing data?<\/p>\n<p>&#8230; <em>Dramatic Silence<\/em> &#8230;<\/p>\n<p>Correct, it&#8217;s <code>.update()<\/code>!<\/p>\n<p>Let&#8217;s say a user update some piece of information, we&#8217;d first want to grab a reference to that user document, then we&#8217;d want to call <code>update()<\/code> and make any changes needed.<\/p>\n<pre><code class=\"language-javascript\">constructor(private fireStore: AngularFirestore) {\n  this.userDoc = fireStore.doc&lt;any&gt;(&#039;userProfile\/we45tfgy8ij&#039;);\n\n  this.userDoc.update({\n    name: &#039;Jorge Vergara&#039;,\n    email: &#039;j@javebratt.com&#039;,\n    \/\/ Other info you want to add here\n  })\n}\n<\/code><\/pre>\n<h2>Remove data from FireStore<\/h2>\n<p>For removing data, we have a few different options:<\/p>\n<ul>\n<li>Removing a specific document (<em>an object<\/em>).<\/li>\n<li>Removing a property or field from a document.<\/li>\n<li>Removing an entire collection.<\/li>\n<\/ul>\n<p>For example, I deleted a user from FirebaseAuth, and now I want to remove the user profile from the database:<\/p>\n<pre><code class=\"language-javascript\">constructor(private fireStore: AngularFirestore) {\n  fireStore.doc&lt;any&gt;(&#039;userProfile\/we45tfgy8ij&#039;).delete();\n}\n<\/code><\/pre>\n<p>Or let&#8217;s say we don&#8217;t want to delete our user, just one field in their document. In that case, we would fetch the user and call <code>delete<\/code> on field we want to remove:<\/p>\n<pre><code class=\"language-javascript\">constructor(private fireStore: AngularFirestore) {\n  fireStore.doc&lt;any&gt;(&#039;userProfile\/we45tfgy8ij&#039;)\n  .update({\n    age: firebase.firestore.FieldValue.delete()\n  });\n}\n<\/code><\/pre>\n<p>Deleting entire collections however, is a bit trickier. Currently, there&#8217;s no way to remove an entire collection in bulk as a safety precaution.<\/p>\n<p>This is because if we were to delete a large amount of data, the Firestore instance would block any other operations until it is completed. Because of this, the Firebase team recommends recursively finding and deleting documents in groups.<\/p>\n<p>There is a &#8220;work around&#8221; for this, but it&#8217;s not recommended as the operation cannot be undone. However, if you need to you can use the <strong>Firebase CLI:<\/strong><\/p>\n<pre><code class=\"language-bash\">$ firebase firestore:delete [options] path...\n<\/code><\/pre>\n<p>It will work fine for when you&#8217;re removing a bunch of test data, but my advice would be to avoid it when you&#8217;re working with production data.<\/p>\n<h2>Next Steps<\/h2>\n<p>This is a quick overview of how you can use Firestore in your Ionic app. For a more detailed guide, I&#8217;ve written a post that will take you through a real-life example explaining everything while we build a Master\/Detail view using Ionic for our front-end and Firebase\/Firestore for our backend.<\/p>\n<p>You can check that post out <a href=\"https:\/\/goo.gl\/SQbPzr\">here!<\/a> Thanks!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a guest post from Jorge Vegara. Check out his courses covering Ionic, PWAs, and Firebase over at https:\/\/jsmobiledev.com. Firestore is a fully managed NoSQL document-based database for mobile and web. It&#8217;s designed to store and sync app data easily. Today, we&#8217;ll go over how to manage data from an Ionic app, using Firestore.<\/p>\n","protected":false},"author":53,"featured_media":2219,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"publish_to_discourse":"","publish_post_category":"","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"","discourse_permalink":"","wpdc_publishing_response":"","wpdc_publishing_error":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[124],"tags":[60,73,101],"class_list":["post-2215","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-angular","tag-firebase","tag-firestore"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.0 (Yoast SEO v23.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Building Ionic Apps with Firestore - Ionic 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:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building Ionic Apps with Firestore\" \/>\n<meta property=\"og:description\" content=\"This is a guest post from Jorge Vegara. Check out his courses covering Ionic, PWAs, and Firebase over at https:\/\/jsmobiledev.com. Firestore is a fully managed NoSQL document-based database for mobile and web. It&#8217;s designed to store and sync app data easily. Today, we&#8217;ll go over how to manage data from an Ionic app, using Firestore.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore\" \/>\n<meta property=\"og:site_name\" content=\"Ionic Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-11T20:07:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-15T22:55:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/firebase_firestore_ionic.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1400\" \/>\n\t<meta property=\"og:image:height\" content=\"560\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jorge Vergara\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javebratt\" \/>\n<meta name=\"twitter:site\" content=\"@ionicframework\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jorge Vergara\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#article\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore\"},\"author\":{\"name\":\"Jorge Vergara\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/0a1b70182dc456f9b26c35bd8450ef81\"},\"headline\":\"Building Ionic Apps with Firestore\",\"datePublished\":\"2018-06-11T20:07:29+00:00\",\"dateModified\":\"2020-10-15T22:55:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore\"},\"wordCount\":1127,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/firebase_firestore_ionic.png\",\"keywords\":[\"Angular\",\"firebase\",\"firestore\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore\",\"url\":\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore\",\"name\":\"Building Ionic Apps with Firestore - Ionic Blog\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/firebase_firestore_ionic.png\",\"datePublished\":\"2018-06-11T20:07:29+00:00\",\"dateModified\":\"2020-10-15T22:55:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#primaryimage\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/firebase_firestore_ionic.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/firebase_firestore_ionic.png\",\"width\":1400,\"height\":560},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ionic.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building Ionic Apps with Firestore\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ionic.io\/blog\/#website\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"name\":\"ionic.io\/blog\",\"description\":\"Build amazing native and progressive web apps with the web\",\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ionic.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ionic.io\/blog\/#organization\",\"name\":\"Ionic\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"width\":1920,\"height\":854,\"caption\":\"Ionic\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/ionicframework\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/0a1b70182dc456f9b26c35bd8450ef81\",\"name\":\"Jorge Vergara\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/jorge-150x150.jpg\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/jorge-150x150.jpg\",\"caption\":\"Jorge Vergara\"},\"sameAs\":[\"https:\/\/javebratt.com\/\",\"https:\/\/x.com\/javebratt\"],\"url\":\"https:\/\/ionic.io\/blog\/author\/javebratt\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Building Ionic Apps with Firestore - Ionic 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:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore","og_locale":"en_US","og_type":"article","og_title":"Building Ionic Apps with Firestore","og_description":"This is a guest post from Jorge Vegara. Check out his courses covering Ionic, PWAs, and Firebase over at https:\/\/jsmobiledev.com. Firestore is a fully managed NoSQL document-based database for mobile and web. It&#8217;s designed to store and sync app data easily. Today, we&#8217;ll go over how to manage data from an Ionic app, using Firestore.","og_url":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore","og_site_name":"Ionic Blog","article_published_time":"2018-06-11T20:07:29+00:00","article_modified_time":"2020-10-15T22:55:17+00:00","og_image":[{"width":1400,"height":560,"url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/firebase_firestore_ionic.png","type":"image\/png"}],"author":"Jorge Vergara","twitter_card":"summary_large_image","twitter_creator":"@javebratt","twitter_site":"@ionicframework","twitter_misc":{"Written by":"Jorge Vergara","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#article","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore"},"author":{"name":"Jorge Vergara","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/0a1b70182dc456f9b26c35bd8450ef81"},"headline":"Building Ionic Apps with Firestore","datePublished":"2018-06-11T20:07:29+00:00","dateModified":"2020-10-15T22:55:17+00:00","mainEntityOfPage":{"@id":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore"},"wordCount":1127,"commentCount":4,"publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"image":{"@id":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#primaryimage"},"thumbnailUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/firebase_firestore_ionic.png","keywords":["Angular","firebase","firestore"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore","url":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore","name":"Building Ionic Apps with Firestore - Ionic Blog","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#primaryimage"},"image":{"@id":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#primaryimage"},"thumbnailUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/firebase_firestore_ionic.png","datePublished":"2018-06-11T20:07:29+00:00","dateModified":"2020-10-15T22:55:17+00:00","breadcrumb":{"@id":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#primaryimage","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/firebase_firestore_ionic.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/firebase_firestore_ionic.png","width":1400,"height":560},{"@type":"BreadcrumbList","@id":"https:\/\/ionic.io\/blog\/building-ionic-apps-with-firestore#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ionic.io\/blog"},{"@type":"ListItem","position":2,"name":"Building Ionic Apps with Firestore"}]},{"@type":"WebSite","@id":"https:\/\/ionic.io\/blog\/#website","url":"https:\/\/ionic.io\/blog\/","name":"ionic.io\/blog","description":"Build amazing native and progressive web apps with the web","publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ionic.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ionic.io\/blog\/#organization","name":"Ionic","url":"https:\/\/ionic.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","width":1920,"height":854,"caption":"Ionic"},"image":{"@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/ionicframework"]},{"@type":"Person","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/0a1b70182dc456f9b26c35bd8450ef81","name":"Jorge Vergara","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/jorge-150x150.jpg","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/jorge-150x150.jpg","caption":"Jorge Vergara"},"sameAs":["https:\/\/javebratt.com\/","https:\/\/x.com\/javebratt"],"url":"https:\/\/ionic.io\/blog\/author\/javebratt"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/06\/firebase_firestore_ionic.png","_links":{"self":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/2215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/comments?post=2215"}],"version-history":[{"count":0,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/2215\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media\/2219"}],"wp:attachment":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media?parent=2215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/categories?post=2215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/tags?post=2215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}