test loop for mongo