I am having problems using forEach if the iterator-function (2nd argument) is a prototype-function of an obejct and uses "this" within its function-body.
Concrete: I am trying to use forEach with "client.add" of node-solr (https://github.com/gsf/node-solr/blob/master/lib/solr.js - line 77).
When I use the following code:
async.forEachSeries( doc_arr, client.add, function(err) {
if( err ) {
throw err;
}
});
I get: 'this' has no function 'update'. Which is in line 109 of the mentioned solr.js.
What can I do?
I am having problems using forEach if the iterator-function (2nd argument) is a prototype-function of an obejct and uses "this" within its function-body.
Concrete: I am trying to use forEach with "client.add" of node-solr (https://github.com/gsf/node-solr/blob/master/lib/solr.js - line 77).
When I use the following code:
I get: 'this' has no function 'update'. Which is in line 109 of the mentioned solr.js.
What can I do?