Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7188538
database-clear.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
468 B
Referenced Files
None
Subscribers
None
database-clear.ts
View Options
import
type
{
App
}
from
"../main"
;
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, Jul 8, 08:15 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
626315
Default Alt Text
database-clear.ts (468 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment