mongodb - How can I sort query result of play morphia with multi field? -
i want query item mongodb using morphia, found order method has 1 parameter, can query data multi order field like:
list items = item.q().order("-updatetime").order("-createtime");
you separate fields commas. wiki has examples: https://github.com/mongodb/morphia/wiki/query#sort
Comments
Post a Comment