NDB query fetch() and ContextOptions

后端 未结 2 1918
庸人自扰
庸人自扰 2021-01-21 11:16

I would like to disable context cache in only one of my queries. I thought I could do it like this:

MyModel.query(ancestor=user.key).fetch(100, options=ContextOp         


        
2条回答
  •  没有蜡笔的小新
    2021-01-21 11:55

    You should just be able to write

    MyModel.query(........).fetch(limit, use_cache=False)
    

    If that doesn't have the desired effect you're looking at some different bug. There should be no need to set a global cache policy for this purpose.

    (It's true that at some point in the past, fetch() didn't support use_cache=...; but that's long been fixed. Also, there's no need to bother with use_memcache=...; it's not used by the query process at all.)

提交回复
热议问题