phillro/node-elasticsearch-client

Canonical callbacks clobbered when passing options parameter

Opened this issue · 0 comments

Do to the way parameters are normalized, passing an options parameter as well as a cb parameter results in the callback being set to false.

For example:

var doc = { data : 'helo' };

// This works
elastic.index('index', 'type', doc, 'id1', function() {...});

// This does not
elastic.index('index', 'type', doc, 'id1', { parent: 'blah' }, function() {...});

I might have time to do a PR in a couple days.