mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 23:33:09 +02:00
core - fix metadata searching
This commit is contained in:
parent
64be0d6ded
commit
4c5a4d2597
1 changed files with 2 additions and 4 deletions
|
@ -81,9 +81,7 @@ export default (
|
||||||
// Check if there is a file with the same hash
|
// Check if there is a file with the same hash
|
||||||
const much = await DriveFile.findOne({
|
const much = await DriveFile.findOne({
|
||||||
md5: hash,
|
md5: hash,
|
||||||
metadata: {
|
'metadata.user_id': user._id
|
||||||
user_id: user._id
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (much !== null) {
|
if (much !== null) {
|
||||||
|
@ -97,7 +95,7 @@ export default (
|
||||||
// Calculate drive usage
|
// Calculate drive usage
|
||||||
const usage = ((await DriveFile
|
const usage = ((await DriveFile
|
||||||
.aggregate([
|
.aggregate([
|
||||||
{ $match: { metadata: { user_id: user._id } } },
|
{ $match: { 'metadata.user_id': user._id } },
|
||||||
{ $project: {
|
{ $project: {
|
||||||
length: true
|
length: true
|
||||||
}},
|
}},
|
||||||
|
|
Loading…
Reference in a new issue