Closed rafaneri closed 7 years ago
Hello @rafaneri
Use the MergeMixin for that: http://agmen-hu.github.io/node-datapumps/docs/mixin/MergeMixin.html
Hi @novaki,
I'm sorry. I've tried, but doesn't work yet. Can you help me please?
var
coll1 = new Pump(),
coll2 = new Pump(),
destination = new Pump();
coll1
.mixin(MongodbMixin(mongoInputURL))
.useCollection('coll1')
.from(coll1.find());
coll2
.mixin(MongodbMixin(mongoInputURL))
.useCollection('coll2')
.from(coll2.find());
var merge = new Pump();
merge
.mixin(MergeMixin)
.from(coll1)
.from(coll2);
destination = new Pump();
destination
.mixin(MongodbMixin(mongoOutputURL))
.useCollection('coll3')
.from(merge)
.process(function (data) {
return destination.insert(data);
})
.logErrorsToConsole()
.run()
.then(function () {
console.log("Done");
});
Hello @novaki,
I forgot to run the pumps!
Hello,
Can I read data from 2 collections and write in an another?
Is possible use a pump to did a findOne inner a process method?