Hi nilesh,
You can use the code snippet as given below to sort with created/modified of json doc
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("orderByDescending", "_$createdAt");
storage.setOtherMetaHeaders(otherMetaHeaders);
Note: This code snippet is for soting of json doc according to creation of document , same can be done for modified date just replace "_$createdAt" with "_$updatedAt" . This code snippet is for java, for more language you can follow the link .