Home twitter


027

May 15, 2020

Another day working with MongoDB. I currently have my app set to run within an open database session. However, as such, I've needed to figure out how to appropriately route the database object to access its methods in other JS files. And this is where I'm currently stuck. I came across this excellent resource, and have been able to get it to work to establish an authenticated connection. The problem is the database object isn't being properly exported to other routes, i.e. I attempt to call methods on the object and I keep getting "db.get().collection is not a function" errors. Super confusing. I'll spend tomorrow (later today, actually, as this is being written at 1:30a) deconstructing this and working through the mongodb node driver documentation to figure this out. Once I get this working, I'll pretty much have figured out how to retrieve and display documents. From there, I'll work on a quick and dirty front-end system to pull up different posts, and have that in place while I work on the authentication aspect and develop a dashboard.

On the note of a front-end, I'm finally understanding how template engines work. I should have the one I'm working on functional as I create the system to pull up and display posts.

In the meantime, the manual writing continues.