rewrite mongo access using promises