#How to sort using readByQuery with SDK

1 messages · Page 1 of 1 (latest)

dapper sedge
#

Looking to sort my results by date added so that new posts/video links are added in order that they were published. The docs don't mention much about options for sorting fields

hazy axleBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please make sure your question includes the following:

  • An explanation of exactly what you're trying to achieve.
  • Any and all related code or previous attempts.
  • The exact issue or error you are facing.
  • Any screenshots if applicable.

When you're done with this thread, please close it.

(If you have a support agreement and need help, please contact the core team via email.)

spare falcon
dapper sedge
#

I keep getting type errors, anything I may be doing wrong here?

#

@spare falcon

spare falcon
#

Not sure how you've implemented your types but the call should work fine assuming you have a date_pubished field within your collection

dapper sedge
#

i don't have type declarations, as I would have assumed the SDK did for defaults

#

here is how this collection is modeled

#

I changed y query to "-date_created" and still have the same error

#

This seems to only give me a "Sort" field to use

#

that doesn't seem helpful

spare falcon
#

Does the actual call work though?