Abstract mongodb operation