diff --git a/src/serialize.js b/src/serialize.js index 74d07a0..e7496ae 100644 --- a/src/serialize.js +++ b/src/serialize.js @@ -3,7 +3,7 @@ import { IndexInterface, DocumentInterface } from "./type.js"; import { create_object, is_string } from "./common.js"; -function async(callback, self, key, index_doc, index, data){ +function async(callback, self, key, field, index_doc, index, data){ setTimeout(function(){ @@ -15,12 +15,12 @@ function async(callback, self, key, index_doc, index, data){ res["then"](function(){ - self.export(callback, self, key, index_doc, index + 1); + self.export(callback, self, field, index_doc, index + 1); }) } else{ - self.export(callback, self, key, index_doc, index + 1); + self.export(callback, self, field, index_doc, index + 1); } }); } @@ -84,7 +84,7 @@ export function exportIndex(callback, self, field, index_doc, index){ return; } - async(callback, self || this, field ? field + "." + key : key, index_doc, index, data); + async(callback, self || this, field ? field + "." + key : key, field, index_doc, index, data); return true; }