Search code examples
androidsql-order-bycouchbase-lite

Couchbase lite 2.0.0-DB021, Android, - OrderBy multiple columns?


How can I translate the following Orderby sql statement to

ORDER BY Country ASC, CustomerID DESC;

I have manage to write Ordering.property("Country").ascending(); but not sure how to add the next condition.

Thanks


Solution

  • If you look at the orderBy method, you will see that it has the following signature

    public OrderBy orderBy(Ordering... orderings)
    

    Note that you can put multiple Ordering objects inside.