appbaseio / appbase-js

appbase.io search client library for JavaScript
MIT License
42 stars 18 forks source link

ReferenceError on using bulk() method #5

Closed siddharthlatest closed 8 years ago

siddharthlatest commented 8 years ago

This is similar to the https://github.com/appbaseio/appbase-js/issues/2 issue.

appbaseObj.bulk({
  type: "tweet",
  body: [
    // action#1 description
    { index: { _id: 2 } },
    // the JSON data to index
    { "msg": "writing my second tweet!",
      "by": "Ev",
      "using": ["appbase.io", "javascript", "streams"],
      "test": true
    },
    // action#2 description
    { delete: { _id: 2 } },
    // deletion doesn't any further input
  ]
}).on('data', function(res) {
  console.log("successful bulk: ", res);
}).on('error', function(err) {
  console.log("bulk failed: ", err);
})

Stacktrace:

Uncaught ReferenceError: id is not defined(…)bulkService 
@ appbase.js:15bulk 
@ appbase.js:436(anonymous function) 
@ VM989:2InjectedScript._evaluateOn 
@ VM931:904InjectedScript._evaluateAndWrap 
@ VM931:837InjectedScript.evaluate 
@ VM931:693