This is a decorator for Final that provides easy-to-use Arango database functions.
☢️ This is under development and the API will change.
const database =
@// do your Final stuff here
You can now use the following class properties on your components:
A schema is an object generated by
flow-runtime. Below is an example. This will change when
flow-runtime is update to
babel@7. There are some useful types exported by
StringLengthType, CollectionType, EmailType).
const UserSchema = ttype'User' tobjectt// ... other propertiesschema = UserSchema// ...
This is simply an array of what schema properties should be unique.
uniques = 'email'
The decorator adds these methods. You should also check the tests file for any I've forgotten to mention.
arangolize object. Returns array.
Same as above, but adds
limit: 1 automatically. Returns object.
Same as above but returns object as below:
data: Array of retultsmeta: count: <Integer of all results>
limit is 25, but the
count will show how many results are in the DB, not just the number returned. Useful for pagination.
// OR, for edge documents
Returns the document that was made, except for edge documents which just return and object with
Accepts either a document object or an id string.
_createdAt key is automaticlly added on all documents, so no need to add your own.