mongodb access refactored with q promise