🎁

12 Days of Baddass Courses sale! Get instant access to the entire egghead library of courses and lessons for 58% off.

Runs out in:
05 : 09 : 43 : 42
1×
Become a member
to unlock all features
Autoplay

    Creating your first FaunaDB database

    Chris BiscardiChris Biscardi
    faunadbFaunaDB

    We walk through creating a new Database in the FaunaDB console complete with some demo data. We do some exploration of the data, introducing concepts like Collections and Indexes, before showing an example FQL query that runs against the database. This sets us up to talk about FQL in future videos

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss

    Transcript

    Transcript

    Instructor: Once you've signed up for a Fauna account, you'll end up at the dashboard. Since I already have a database in my account, I see it right here along with the readops, the writeops, storage, and data transfer.

    To create a new database, we'll click create new database. We'll give our database a name and let Fauna prepopulate it with demo data. This demo data creates a warehouse data structure for us.

    Now that we've created our database with the demo data, we can see that there are a number of collections and a number of indexes. If we look at the customers collection, we can see a number of objects or documents. These documents can be explored through the UI.

    Indexes are groups of documents inside of each of our collections. In this case, we have indexes that represent all the objects in each of our collections. If we go to the shell on the FaunaDB console, we can use FQL to write a query.

    This query matches on the index all customers, paginates the results, selects the data from the pagination, and maps over the results of the pagination using a Lambda. Since in the Lambda, the argument is a ref, we have to get the object.

    Finally, we select the first name from all of the data. If we run this query, we can see that we do indeed get all first names.