more s3 script testing
This commit is contained in:
parent
c9df78a667
commit
14d1c33951
1 changed files with 4 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
import mongoose from 'mongoose';
|
import mongoose from 'mongoose';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import { uniqWith, isEqual } from 'lodash';
|
||||||
require('dotenv').config({path: path.resolve('.env')});
|
require('dotenv').config({path: path.resolve('.env')});
|
||||||
const ObjectId = mongoose.Types.ObjectId;
|
const ObjectId = mongoose.Types.ObjectId;
|
||||||
mongoose.connect('mongodb://localhost:27017/p5js-web-editor');
|
mongoose.connect('mongodb://localhost:27017/p5js-web-editor');
|
||||||
|
@ -26,7 +27,7 @@ let client = s3.createClient({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const s3Files = [];
|
let s3Files = [];
|
||||||
|
|
||||||
Project.find({})
|
Project.find({})
|
||||||
.exec((err, projects) => {
|
.exec((err, projects) => {
|
||||||
|
@ -38,6 +39,8 @@ Project.find({})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
console.log(s3Files.length);
|
console.log(s3Files.length);
|
||||||
|
s3Files = uniqWith(s3Files, isEqual);
|
||||||
|
console.log(s3Files.length);
|
||||||
});
|
});
|
||||||
|
|
||||||
const uploadedFiles = [];
|
const uploadedFiles = [];
|
||||||
|
|
Loading…
Reference in a new issue