Working version of inputs and outputs using MongoDB.