How to create cursor with NDB map

According to the documentation , the function map

supports all query keywords. However, I cannot get the values cursor

and has_more

using the map. How do you do it? If I use fetch

to create result

, cursor

and has_more

, I can't use map

it anymore as it doesn't work on simple lists.

+3


source to share


1 answer


You cannot get the cursor from the map () - the only way to get the cursor is by using a QueryIterator or by calling fetch_page () (which uses a QueryIterator internally). The has_more flag is only available with fetch_page ().

If you have a simple list, use Python's built-in map () function:



map(<function>, <list-of-entries>)

      

But maybe you could tell us more about what you are trying to do?

+4


source







All Articles