CRUD using Cloud Firestore

Learn how to execute CRUD operations using Cloud Firestore and React Native.

CRUD (create, read, update, and delete) are the four basic persistent storageA type of storage that retains data after the power has been shut off, e.g., hard disk drive. operations. CRUD operations allow us to search, view, and modify data inside a database. Programmers and developers have to deal with CRUD operations at some stage of their career, i.e., CRUD is used while signing up or logging in users inside an application. Therefore, it is essential to learn the basics of CRUD operations. This lesson will show how we can search, view, modify, and delete data inside a Firebase database (Cloud Firestore) using React Native. Before beginning, make sure you have the Cloud Firestore database up and running.

Create

As the name applies, the “create” operation in CRUD is used to create a new entry inside the database. To implement the “create” operation, we first have to import these functions from the @firebase/firestore library:

  • collection

  • addDoc

Get hands-on with 1200+ tech skills courses.