Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F995822
metadata.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
748 B
Referenced Files
None
Subscribers
None
metadata.ts
View Options
import
type
{
App
}
from
"../main"
;
const
COLLECTION_NAME
=
"_metadata"
;
export
default
class
Metadata
{
db_collection_name
=
COLLECTION_NAME
;
app
:
App
;
constructor
(
app
:
App
)
{
this
.
app
=
app
;
}
async
get
(
key
:
string
|
number
)
{
const
matches
=
await
this
.
app
.
Datastore
.
find
(
COLLECTION_NAME
,
{
key
});
if
(
matches
.
length
)
{
return
matches
[
0
].
value
;
}
else
{
undefined
;
}
}
async
set
(
key
:
string
,
value
:
string
|
number
)
{
const
matches
=
await
this
.
app
.
Datastore
.
find
(
COLLECTION_NAME
,
{
key
});
if
(
matches
.
length
)
{
await
this
.
app
.
Datastore
.
update
(
COLLECTION_NAME
,
{
key
:
key
},
{
$set
:
{
value
:
value
}
}
);
}
else
{
await
this
.
app
.
Datastore
.
insert
(
COLLECTION_NAME
,
{
key
,
value
});
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Mon, Dec 23, 20:50 (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556968
Default Alt Text
metadata.ts (748 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment