From eb3ceceafafd007c4a6d30e181815f8076db4ff8 Mon Sep 17 00:00:00 2001 From: oldhu Date: Fri, 8 Oct 2021 10:19:09 +0800 Subject: [PATCH] fix nested export key --- src/serialize.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/serialize.js b/src/serialize.js index 14a00c6..98102d9 100644 --- a/src/serialize.js +++ b/src/serialize.js @@ -1,7 +1,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(){ @@ -13,12 +13,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); } }); } @@ -82,7 +82,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; }