I am working on a web app to create, organize and quickly use your code snippets, with plans of VS Code integration to sync snippets to your snippets json files.
I have two mongoose models, one called "groups" and one called "snippets". A user can create a snippet just fine, but now I want to make the groups model act as a way to group multiple snippets together. So one of the fields in the collections model is an array that defaults to an empty array.
So now to get to the point. I need that snippets array contain actual references to a document in the snippets collection. This way it can be dynamic and let me do things such as going to delete the snippet only, and now a groups document automatically removes the reference from the array.