Not working implementation of MongoDB