badgerhold icon indicating copy to clipboard operation
badgerhold copied to clipboard

SortBy ASC and DESC per Field

Open artvel opened this issue 2 years ago • 3 comments

badgerhold is awesome!

  • [ ] To make the query even better it would be nice to have the possibility to define ASC or DESC per field.

What do you guys think?

artvel avatar Apr 23 '22 12:04 artvel

That's what the Reverse method does.

Where("field").Eq(value).SortBy("field").Reverse()

I'm glad you think badgerhold is awesome.

timshannon avatar Apr 23 '22 13:04 timshannon

Yes, it does. But you can't combine it with multiple fields.

artvel avatar Apr 23 '22 14:04 artvel

Apologies, I didn't' read the issue close enough. You're correct. Having multiple independent sorting per field isn't really doable currently.

Thanks for reporting.

timshannon avatar Apr 23 '22 14:04 timshannon