mirror of
https://github.com/typesense/typesense.git
synced 2025-05-22 23:06:30 +08:00
Fix empty reference array field update. (#1820)
This commit is contained in:
parent
8047b9f359
commit
b0014f9c05
@ -349,6 +349,9 @@ Option<bool> Collection::add_reference_helper_fields(nlohmann::json& document, c
|
||||
filter_query += ",";
|
||||
}
|
||||
if (!filter_values_added) {
|
||||
document[reference_helper_field] = nlohmann::json::array();
|
||||
document[fields::reference_helper_fields] += reference_helper_field;
|
||||
|
||||
continue;
|
||||
}
|
||||
filter_query[filter_query.size() - 1] = ']';
|
||||
|
@ -1408,7 +1408,7 @@ TEST_F(CollectionJoinTest, JoinAfterUpdateOfArrayField) {
|
||||
ASSERT_EQ(1, res["hits"][0]["document"]["bodyParts"].size());
|
||||
ASSERT_EQ(1, res["hits"][0]["document"]["parts"].size());
|
||||
|
||||
exercise_doc["bodyParts"] = {};
|
||||
exercise_doc["bodyParts"] = nlohmann::json::array();
|
||||
ASSERT_TRUE(exercise_coll->add(exercise_doc.dump(), UPDATE).ok());
|
||||
|
||||
req_params = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user