java - Spring MongoTemplate updateMulti with Limit? -


i'm using spring data's mongotemplate update multiple documents single query. need able limit number of documents update per call. reasons unclear me limit isn't working:

query query = new query(     criteria.where( "foo" ).is( bar )     .and( "status" ).is( 1 ) ); query.limit( 10 );  update update = new update(); update.set( "status", 2 );  writeresult result = mongotemplate.updatemulti( query, update, "bazcollection" );  logger.info( result.getn() + " documents updated" ); 

result.getn() returns total number of documents meet criteria , ignoring limit, , documents meeting criteria modified.

is there reason isn't working?

is there better approach accomplish same thing?


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -