I use perl script as a client to query mongoDB databases.my code is as below:
my $some_users = $users->find({"name" => "Joe"});
while (my $doc = $all_users->next) {
print $doc->{'name'}."\n";
}
cpan tutorial says:
find returns a MongoDB::Cursor, which can be iterated over. It lazily loads results from the database.
And yes, after my careful observation,I find that it takes a very short time when calling the find() , instead, the iteration of MongoDB::Cursor will take a long time if the find() function returns many data.So ,I becomes very confused,what does it mean by lazy load?Lazy load means "do nothing" ?lazy load means cheating?