Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F9582190
aggregate.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
540 B
Referenced Files
None
Subscribers
None
aggregate.js
View Options
"use strict"
;
const
Promise
=
require
(
"bluebird"
);
module
.
exports
=
function
(
app
)
{
return
{
name
:
"aggregate"
,
calculate
:
function
(
context
,
params
,
item
,
db_document
)
{
let
stages
=
params
.
stages
;
if
(
params
.
stages
instanceof
Function
)
{
stages
=
params
.
stages
(
context
,
params
,
item
,
db_document
);
}
return
app
.
Datastore
.
aggregate
(
params
.
collection
,
stages
).
then
(
function
(
documents
)
{
if
(
documents
.
length
)
{
return
documents
[
0
].
result
;
}
else
{
return
null
;
}
}
);
},
};
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 11, 06:15 (4 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
983718
Default Alt Text
aggregate.js (540 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment