I want to create following Json object
{
"name":"abc",
"property1"=[2010, 2013, 2015],
"property2"=["str1, "str2", str3"],
"property3"=[true, false]
}
property1, property2, property3 is basically an array but with distinct elements. Currently I am creating through:
document.AddMember("property1", Value(kArrayType), allocator);
document.AddMember("property2", Value(kArrayType), allocator);
document.AddMember("property3", Value(kArrayType), allocator);
Then I iterate over the list and push the value in the object through:
for (auto& iter: object_info_list) {
document["property1"].PushBack(iter->property1, allocator); //int value
document["property2"].PushBack(iter->property2, allocator); // string value
document["property3"].PushBack(iter->property3, allocator); // bool value
}
But the above statement pushes all the values (duplicates) as well. Is there a way to add distinct values only (like set in c++)
Thank you in advance