plugin updated for NodeBB v1.x.x
SOLVED Proper way to store JSON data under a user?
Is there a proper way to store JSON data under a user in the database (via the UID), and if so what would be the best way to retrieve such?
Is this a plugin? It's best for you to store it under a
plugin:myplugin:<uid>hash. This way you don't pollute the core user hash with things in case the admin removes the plugin and uses something else which might even have that same field.
We don't have any restrictions on that at the moment, but this makes me realize we should write a "best practices" doc for plugins.
Plugin. Thanks! And yeah, that would be super helpful!
So basically you can use
db.setObjectyour object instead of JSON.stringify, then
db.getObjectto retrieve. Hopefully straightforward
@psychobunny Perfect! I sent you a PM regarding such.