migration to GridFS's DriveFile

This commit is contained in:
otofune
2017-11-06 15:18:45 +09:00
parent 7e81e0db6a
commit 18b1ef29ad
11 changed files with 66 additions and 70 deletions

View File

@ -40,8 +40,10 @@ module.exports = (params, user, app) => new Promise(async (res, rej) => {
_id: -1
};
const query = {
user_id: user._id,
folder_id: folderId
metadata: {
user_id: user._id,
folder_id: folderId
}
} as any;
if (sinceId) {
sort._id = 1;
@ -57,9 +59,6 @@ module.exports = (params, user, app) => new Promise(async (res, rej) => {
// Issue query
const files = await DriveFile
.find(query, {
fields: {
data: false
},
limit: limit,
sort: sort
});