A JavaScript script to simulate Mongodb