build a library based on mongodb