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