iterating through mongodb