You need to create a collection to store your data. You can do this with the following constructor. If you want to store your data as a collection, you need to set the collection type to 0. In this case, the data can be filtered more easily. If you want to make it key-value, you need to set the collection type as 1. In this case, you can assign a value to a key. For example username=fir4tozden.
const example_collection = new <PeakDB | Connection>.Collection({
"name": "EXAMPLE_COLLECTION",
"type": 0,
/*
For document-based collections
*/
"id_length": 32,
"indicate_created_at": false,
"indicate_created_timestamp": true,
"indicate_updated_at": false,
"indicate_updated_timestamp": true,
"indicate_archived_at": false,
"indicate_archived_timestamp": true,
"indicate_unarchived_at": false,
"indicate_unarchived_timestamp": true,
/*
Can be used on all collection types
*/
"save_timeout": 1,
"save_directly_after": 5,
"cache_retention_time": 10,
"backup_retention_time": 3,
"caching": true,
"auto_create_backup": true,
"detailed_debugger_logs": true,
"activate_destroy_function": false
});
Store Data
Each collection type has different methods to store your data. For example, you can use this method in document-based collections. For key-value-based collections you can use it like this for example.