Sign in

Zach

@zephyrusk.vodnotebook.com
62 followers 350 following 14 posts

Pfp: avogado6 He/him. UMaine CS/MAT '25. Currently working on vodnotebook.com.

PostsRepliesMedia
Zach @zephyrusk.vodnotebook.com · 08/04/2026
This is what Benny Feldman does!
020 0
Zach @zephyrusk.vodnotebook.com · 01/03/2026
Ran this again today, let's see if it works out for him
020 0
Zach @zephyrusk.vodnotebook.com · 16/01/2026
A week from today (1/23) I will be in Connecticut and the next day (1/24) I will be in NYC. Any recommendations for cool stuff to do around Hartford/New Haven/NYC?
010 0
Zach @zephyrusk.vodnotebook.com · 15/01/2026
Back to 12/12 we are so back. Now I can finally write new tests to fail for the features I just added.
010 0
Zach @zephyrusk.vodnotebook.com · 15/01/2026
3/12 tests passing
010 0
Zach @zephyrusk.vodnotebook.com · 14/01/2026
Been in such a rut coding today that I have decided I am writing everything today and not testing it until tomorrow. Almost finished for the night, so I'm feeling a bit better. Surely this will have no unforeseen consequences.
010 0
Zach @zephyrusk.vodnotebook.com · 13/01/2026
This is super useful for implementing a generic cascading soft delete in my application, where I am managing soft deletion and reference management in separate plugins. This would also allow me to extend an existing plugin without breaking the base version. Cool!
010 0
Zach @zephyrusk.vodnotebook.com · 13/01/2026
This turned out to not be the case! On a whim, I tried passing "deleteOne" to the middleware function post() with a callback, and it worked! Mongoose automagically took up the name of my instance method and enabled middleware on it. From what I can tell, this is not mentioned in the documentation.
110 0
Zach @zephyrusk.vodnotebook.com · 13/01/2026
I wanted to trigger some middleware when softDelete() was called. The Mongoose documentation lists the strings that can be passed to pre/post -- like the built-ins save and find. Cursory research seemed to suggest that this list was not extendable and I'd have to handle this without middleware.
110 0
Zach @zephyrusk.vodnotebook.com · 13/01/2026
I'm writing middleware inside Mongoose plugins. Plugins can also add static and instance methods to Schemas. For example, I define `schema.methods.softDelete = function(){}` as an instance method which sets the `deleted` property of a document (a Model instance) to true.
110 0
Zach @zephyrusk.vodnotebook.com · 13/01/2026
Each query type also comes extendable middleware, so you can define code that runs before (pre) or after (post) every query of a specific type. So, by doing `schema.post("find", function(){})`, you can define a function that runs every after each find() query on a particular Schema (e.g. a User).
110 0
Zach @zephyrusk.vodnotebook.com · 13/01/2026
I'm learning to use Mongoose ODM for working with my MongoDB right now and found something very cool about middleware and feel compelled to share. Mongoose provides functions for your standard database CRUD operations, like find() and save(), which do what you probably expect them to.
110 0
Zach @zephyrusk.vodnotebook.com · 11/01/2026
Watched Ted (my older brothers’ favorite movie) tonight. My favorite joke was the passing mention of a strain of pot called “This is Permanent”
010 0
Zach @zephyrusk.vodnotebook.com · 09/01/2026
Going to start posting on here, probably.
130 0