removes mongo; updates to handle arbitrary pkeys