⚠️ This lesson is retired and might contain outdated information.

Creating your first FaunaDB database

Chris Biscardi
InstructorChris Biscardi
Share this video with your friends

Social Share Links

Send Tweet
Published 5 years ago
Updated 3 years ago

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

Lecturer: [00:00] 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 read ops, the write ops, the storage and the data transfer.

[00:10] To create a new database, we'll click Create New Database. We'll give our database a name, and we'll let FaunaDB repopulate it with demo data. This demo data creates a simple warehouse data structure for us.

[00:30] 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 indices. If we look at the customer's collection, we can see a number of objects, or documents. Documents can be explored through the UI, indexes or groups of documents inside each of our collections.

[00:48] In this case, we have indexes that represent all of the customers, so we see all of the customer documents. If we go to the shell in 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, maps over the results of the pagination using a lambda.

[01:11] Since in a lambda, the argument is a ref, we have to get object. Finally, we select the first name from all of the data. If we run this query, we can see that the result shows all the first names.

egghead
egghead
~ 8 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today