Fixed Query Request deserialization

This commit is contained in:
Fabio Sinibaldi 2021-12-01 12:33:03 +01:00
parent 820ea7203f
commit 8118177c6d
1 changed files with 2 additions and 2 deletions

View File

@ -49,9 +49,9 @@ public class Serialization {
Document queryDocument = Document.parse(queryString);
log.debug("Document is ",queryDocument.toJson());
QueryRequest req = new QueryRequest();
if (queryDocument.containsKey("ordering"))
if (queryDocument.getOrDefault("ordering",null)!=null)
req.setOrdering(Serialization.read(((Document) queryDocument.get("ordering")).toJson(), QueryRequest.OrderedRequest.class));
if (queryDocument.containsKey("paging"))
if (queryDocument.getOrDefault("paging",null)!=null)
req.setPaging(Serialization.read(((Document) queryDocument.get("paging")).toJson(), QueryRequest.PagedRequest.class));
req.setProjection(queryDocument.get("projection", Document.class));
req.setFilter(queryDocument.get("filter", Document.class));