Skip to content
Snippets Groups Projects
Commit f1bc2be6 authored by Andreas Gärtner's avatar Andreas Gärtner
Browse files

Request freetext answer sorted descending by timestamp.

parent 04e12898
No related merge requests found
...@@ -1029,7 +1029,9 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware ...@@ -1029,7 +1029,9 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware
if (limit > 0) { if (limit > 0) {
view.setLimit(limit); view.setLimit(limit);
} }
view.setKey(questionId); view.setDescending(true);
view.setStartKeyArray(questionId, "{}");
view.setEndKeyArray(questionId);
final ViewResults results = getDatabase().view(view); final ViewResults results = getDatabase().view(view);
if (results.getResults().isEmpty()) { if (results.getResults().isEmpty()) {
return answers; return answers;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment