more s3 script testing

This commit is contained in:
Cassie Tarakajian 2016-12-13 20:36:48 -05:00
parent c9df78a667
commit 14d1c33951

View file

@ -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 = [];