Using Mongo database to store permalinks