It is up to @pichalite now.
Custom page + nodebb current user + mongodb access
Good evening gents and thanks for this amazing platform.
Being a NodeBB newbie please be patient and carry on if something sounds stupid down here.
Although I've some programming background I completely lack many concepts around NodeBB thus my question might look dumb or even impossible to answer... but let's try!
In the need of creating a custom page i've installed nodebb-plugin-custom-pages plugin and I've been able to display something in my custom page and to execute some stupid JS code.
The point writing some JS code in the page is it possible to:
- retrieve the current user browsing the page and use this information to programmatically modify the page?
- to connect to the underlying mongoDB and perform some operations on it?
Any advise will be really helpful to understand if I'm on the right way or not.
Thanks a lot PitaJ for the first point!
With regard to #2 the idea is to query for a value stored in mongo, assign this value to the user currently logged and store back on the DB the value increase by one. Actually this can be done directly writing in the objects collections or alternatively create a new collection.
Any thoughts here?