diff --git a/lib/import.js b/lib/import.js index 93c7b7d..d828ee4 100644 --- a/lib/import.js +++ b/lib/import.js @@ -38,8 +38,11 @@ function importCollections(opts, callback) { if (!collection) { return cb('> Missing collection name in call to importOne method'); } + //console.log(collection); + collection = /[^/]*$/.exec(collection)[0]; return fsBackend.readFile(`${dataDir}/${collection}.json`, (readErr, readData) => { + //return fsBackend.readFile(`${collection}.json`, (readErr, readData) => { if (readErr) { return cb(readErr); } @@ -119,7 +122,6 @@ function main(opts, callback) { // 1. get collections const allCollections = fsBackend.scanDirSync(dataDir); - const resolved = resolveSelections( allCollections, collectionsToInclude, @@ -137,7 +139,6 @@ function main(opts, callback) { connection: connDb, dataDir }; - return importCollections(newOpts, callback); }); }