Change mechanism to work with mongodb schema