Skip to main content

Creating Our Schema

In our schema, we'll have one collection, wallet, with three predicates:

  • wallet/user - a reference to a _user (a built-in ledger collection)
  • wallet/balance
  • wallet/name

Do you remember how to create a schema?

  • Remember, you need to specify a type. The most basic and common types are int (numbers), string (text), and ref (references). For a ref type, it is good practice to specify a restrictCollection, so the ref can only refer to a subject in a specific collection.

  • Some predicates may also need to be unique.

Create the Schema

Create the collection (wallet) and three predicates mentioned above.