2014년 12월 30일 화요일

Overflow of the memory in a cursor with java api

Hi, I'm making a program that makes backups of a database in mongousing the APIs mongodb. My question is, if I open a cursor without filter,from the beginning I have all the data in the database? If yes is there any way to avoid a fall overflow memory



That's not how cursors work.  You get back a cursor (which is just a
pointer into a result set) and then you have to iterate over it (i.e.
request documents one at a time).  Driver gets documents from the
server in batches, but those are relatively small (compared to the
full data set).

Why do you need to write your own backup program?



Thanks Asya Kamsky, 

I worried much about the cursor Como No java dominated not know if it was different from other languages.
I have found no way to do a JAVA program , is there ? Anyway prevent the user (my sister) have to enter the console to make an export ...
Do you know any method?

Thanks for your help


댓글 없음:

댓글 쓰기