Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996007
database-clear.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
471 B
Referenced Files
None
Subscribers
None
database-clear.ts
View Options
import
type
{
App
}
from
"../main.js"
;
export
async
function
databaseClear
(
app
:
App
)
{
if
(
app
.
Datastore
.
db
)
{
app
.
Logger
.
info
(
"TEST APP"
,
"Clearing the database..."
);
for
(
const
collection_name
in
app
.
collections
)
{
// eslint-disable-next-line no-await-in-loop
await
app
.
Datastore
.
remove
(
collection_name
,
{},
"just_one"
&&
false
);
}
await
app
.
Datastore
.
remove
(
app
.
Metadata
.
db_collection_name
,
{},
"just_one"
&&
false
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Dec 24, 06:33 (22 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556312
Default Alt Text
database-clear.ts (471 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment