some function to use mongoDB with coffeescript