开发者

How do I query the AppEngine DB comparing two properties of the same entity?

I'd like to make a query to return all the entities of a given type where one property is greater than anot开发者_如何转开发her. For example, return all Widgets where selling price is greater than buying price. I can't seem to figure out how to do it in the Google AppEngine datastore.


You can't do this directly, because the indexing model does not support complex expressions like that. You'll have to add a new property that you manually maintain as the difference between buying and selling price, then search for items where this delta property is greater than or less than zero.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜