Appengine filter inequality and ordering fails

前端 未结 5 1566
悲哀的现实
悲哀的现实 2021-02-01 18:03

I think I\'m overlooking something simple here, I can\'t imagine this is impossible to do.

I want to filter by a datetime attribute and then order the result by a rankin

5条回答
  •  醉梦人生
    2021-02-01 18:38

    I don't know since when, but current SDK may return subtle different error:

    BadArgumentError: First ordering property must be the same as inequality filter property, if specified for this query; received ranking, expected submitted
    

    In my case, I could work around the error with this:

    query.filter("submitted >=" thisweek).order("submitted").order("ranking")
    

    Edited 2013-02-08: As Horselover Fat mentioned in a comment, it only avoids an error.

提交回复
热议问题