migration to GridFS's DriveFile
This commit is contained in:
parent
7e81e0db6a
commit
18b1ef29ad
11 changed files with 66 additions and 70 deletions
|
|
@ -14,16 +14,16 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
|||
// Calculate drive usage
|
||||
const usage = ((await DriveFile
|
||||
.aggregate([
|
||||
{ $match: { user_id: user._id } },
|
||||
{ $match: { metadata: { user_id: user._id } } },
|
||||
{
|
||||
$project: {
|
||||
datasize: true
|
||||
length: true
|
||||
}
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: null,
|
||||
usage: { $sum: '$datasize' }
|
||||
usage: { $sum: '$length' }
|
||||
}
|
||||
}
|
||||
]))[0] || {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue