Availability date range queries in app engine datastore?

前端 未结 2 345
有刺的猬
有刺的猬 2021-01-27 12:46

I\'ve looked through a bunch of other threads on this topic, and so far I haven\'t found any satisfactory answers, so I wanted to double check if it\'s really just not feasible

相关标签:
2条回答
  • 2021-01-27 13:04

    Use the search api as you suggest. I had the same problem of multiple inequalities and slso used search api to solve it.

    0 讨论(0)
  • 2021-01-27 13:06

    If you have a relatively small number of entities (not in millions), you can run two keys-only queries - one for start date and one for end date, and then find the intersection of results. Keys-only queries are almost free and very fast.

    If there are some other limitations on your data, you can use them to optimize this process. For example, if the availability range has a duration limit, you can loop through the start-date query until you reach a date at which an entity can no longer be available, because the start date is too far away from the desired end date. Then do the same with the end date query.

    0 讨论(0)
提交回复
热议问题