fixed bug when extracting names from list
This commit is contained in:
@@ -37,6 +37,7 @@ def list_names(
|
||||
query = {}
|
||||
if has_annotation:
|
||||
query['annotation'] = {'$ne': None}
|
||||
# execute query
|
||||
res_list = collection.find(
|
||||
filter=query,
|
||||
projection={
|
||||
@@ -44,7 +45,9 @@ def list_names(
|
||||
'name': True,
|
||||
},
|
||||
)
|
||||
return list(res_list)
|
||||
# extract information
|
||||
name_list = [elem['name'] for elem in res_list]
|
||||
return name_list
|
||||
|
||||
|
||||
def total_documents(
|
||||
|
||||
Reference in New Issue
Block a user