add sort to query
1 open thread
1 open thread
Compare changes
+ 35
− 7
@@ -5,6 +5,7 @@ from datetime import datetime
@@ -5,6 +5,7 @@ from datetime import datetime
@@ -116,10 +117,14 @@ class DataProductDB:
@@ -116,10 +117,14 @@ class DataProductDB:
@@ -128,8 +133,15 @@ class DataProductDB:
@@ -128,8 +133,15 @@ class DataProductDB:
@@ -142,7 +154,6 @@ class DataProductDB:
@@ -142,7 +154,6 @@ class DataProductDB:
@@ -193,8 +204,25 @@ def get_tasks(collection_name: str, task_id: str, request: Request):
@@ -193,8 +204,25 @@ def get_tasks(collection_name: str, task_id: str, request: Request):
raise exceptions.HTTPException(status_code=404, detail=f'Collection {collection_name} does not exist')
def get_tasks(collection_name: str, request: Request, skip: int = 0, limit: int = 100, filter: Union[str, None] = None, select: Union[str, None] = None):
@@ -208,7 +236,7 @@ def get_tasks(collection_name: str, request: Request, skip: int = 0, limit: int
@@ -208,7 +236,7 @@ def get_tasks(collection_name: str, request: Request, skip: int = 0, limit: int
return DB.get_items(collection_name, query=query, limit=limit, skip=skip, url=from_urlobj_to_url(request.url), select=select)
raise exceptions.HTTPException(status_code=404, detail=f'collection {collection_name} does not exist')
are you sure you dont have to parse the json field distinct too?
I don't think so, because it works :-)
the 'distinct' is not inside the json query. The .find() takes a json query, but the .distinct() is chained to it like: ".find(query,distinct).distinct(distinct)"
yeah but then is it a dict or just a string?
just a string
&distinct=OBSERVATION_ID