mongo helper functions