json :: JsonStore :: list_collection
key
.
# Get the list of keys stored under the collection `key`.
fun list_collection(key: String): JsonArray do
var res = new JsonArray
var coll = ("{store_dir}/{key}".simplify_path).to_path
if not coll.exists or not coll.stat.is_dir then return res
for file in coll.files do
if file.to_s.has_suffix(".json") then
res.add(file.to_s.basename(".json"))
end
end
return res
end
lib/json/store.nit:161,2--172,4