Writing data
In this document, you’ll learn how to write data to your database with Typesaurus.
There are several methods that allow writing documents:
add
- adds a document with a random idset
- sets specific documentupdate
- updates specific documentupset
- updates or sets specific documentremove
- removes a document
add
To add a document with random id:
set
To set a document:
set
is also available on Ref
and Doc
:
update
To update a document with a specific id:
If the document doesn’t exist, it will throw an error.
update
is also available on Ref
and Doc
:
upset
To update or set a document:
If the document doesn’t exist, it will be set.
upset
is also available on Ref
and Doc
:
remove
To remove a document: