google app engine - Datastore query with limit -


i'm using remoteapi (java) go through large dataset, ~90k entities, , perform data migration.

int chunk_size = 500; int limit = 900;   queryresultlist<entity> result = ds.prepare(entityquery) .asqueryresultlist(     fetchoptions.builder     .withprefetchsize(chunk_size)     .limit(limit)     .chunksize(chunk_size) ).startcursor(cursor); 

with query limit set 900the result.size() entire dataset, ~90k, instead of 900. if try lower limit, 300, result size expected 1 (300).

what missing here? documentation couldn't figure out why produces behaviour i'm describing here.

based on these examples (http://www.programcreek.com/java-api-examples/index.php?api=com.google.appengine.api.datastore.queryresultlist)

i think should use .withlimit(limit) instead of .limit(limit) within .asqueryresultlist options

so restructure code follows:

fetchoptions options = fetchoptions.builder     .withlimit(limit)     .withprefetchsize(chunk_size)     .chunksize(chunk_size);  queryresultlist<entity> result = ds.prepare(entityquery)     .asqueryresultlist(options); 

then cursor

result.getcursor(); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -