Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const preResponseHandler = result => {
if (opts.serializeResult === true) {
return serialize(result)
}
return result
}
collection = yield collections.next()) {
let namespace = ns(`test.${collection.name}`);
if (namespace.system || namespace.oplog || namespace.special) {
continue;
}
if (!first) {
stream.write(',\n');
first = false;
}
stream.write(`"${collection.name}": [\n`);
const cursor = db.collection(collection.name).find();
for (let doc = yield cursor.next();
doc != null;
doc = yield cursor.next()) {
stream.write(JSON.stringify(ejson.serialize(doc), null, ' '));
}
stream.write(`\n]`);
}
stream.write(`\n}`);
});
}
res[collection] = contents[i].map(doc => ejson.serialize(doc));
});