Make sampling to mongodb work for multiple loci