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 areint
(numbers),string
(text), andref
(references). For aref
type, it is good practice to specify arestrictCollection
, so theref
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.