hendrysadrak / firestore-store

express-session store for Firebase Cloud Firestore
https://npm.im/firestore-store
MIT License
48 stars 3 forks source link

Changing saved data to maps #57

Closed garcia-s closed 3 years ago

garcia-s commented 3 years ago

Hi, I mean no harm but I changed the package a little bit and got this code going on the doc parser. I was able to save the session info as a map instead of a string. Don't really know what problems this might introduce but maybe you can add it to the project.

module.exports = {
    read (doc) {
        return doc;
    },

    save (doc) {
        return JSON.parse(JSON.stringify(doc));
    }
};

Here is a screenshot of what the data looks like on firestore. Your proyect save me from having to change the whole db BTW.

Captura de pantalla 2020-10-09 155656