From c16247b5e3bf513c14d724270f3f486972604003 Mon Sep 17 00:00:00 2001 From: richard-epsilla Date: Sat, 29 Jul 2023 18:55:57 -0700 Subject: [PATCH] Fix empty array set bug --- README.md | 2 +- engine/utils/json.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bf74c041..a279a8dd 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Epsilla's core is written in C++ and leverages the advanced academic parallel gr **1. Run Backend in Docker** ```shell docker pull epsilla/vectordb -docker run --pull=always -d -p 8888:8888 epsilla/vectordb +docker run --pull=always -d -p 8888:8888 -v /tmp:/tmp epsilla/vectordb ``` **2. Interact with Python Client** diff --git a/engine/utils/json.cpp b/engine/utils/json.cpp index e5f56c50..eb08e392 100644 --- a/engine/utils/json.cpp +++ b/engine/utils/json.cpp @@ -142,6 +142,7 @@ void Json::SetObject(const std::string& key, const Json& object) { } void Json::SetArray(const std::string& key, const std::vector& array) { + doc_[key] = nlohmann::json::array(); for (const auto& item : array) { doc_[key].push_back(item.doc_); }