diff --git a/src/api.cpp b/src/api.cpp index 6931a662..46b6ef54 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -16,7 +16,8 @@ void get_collections(http_req & req, http_res & res) { for(Collection* collection: collections) { nlohmann::json collection_map; collection_map["name"] = collection->get_name(); - json_response["data"].push_back(collection_map); + collection_map["num_documents"] = collection->get_num_documents(); + json_response["collections"].push_back(collection_map); } res.send_200(json_response.dump()); diff --git a/src/collection.cpp b/src/collection.cpp index 369b84e6..318b12c9 100644 --- a/src/collection.cpp +++ b/src/collection.cpp @@ -861,8 +861,8 @@ Option Collection::search(std::string query, const std::vector