Fixed Query Request deserialization
This commit is contained in:
parent
820ea7203f
commit
8118177c6d
|
@ -49,9 +49,9 @@ public class Serialization {
|
||||||
Document queryDocument = Document.parse(queryString);
|
Document queryDocument = Document.parse(queryString);
|
||||||
log.debug("Document is ",queryDocument.toJson());
|
log.debug("Document is ",queryDocument.toJson());
|
||||||
QueryRequest req = new QueryRequest();
|
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));
|
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.setPaging(Serialization.read(((Document) queryDocument.get("paging")).toJson(), QueryRequest.PagedRequest.class));
|
||||||
req.setProjection(queryDocument.get("projection", Document.class));
|
req.setProjection(queryDocument.get("projection", Document.class));
|
||||||
req.setFilter(queryDocument.get("filter", Document.class));
|
req.setFilter(queryDocument.get("filter", Document.class));
|
||||||
|
|
Loading…
Reference in New Issue