A Pen by Aakash Gill on CodePen.
| Total props to Brian Cray: http://briancray.com/posts/estimated-reading-time-web-design/ |
| /** Quick and dirty Cart pub/sub example */ | |
| class CartStore { | |
| add(item) {} | |
| remove(index) {} | |
| update(index, item) {} | |
| get(index) {} | |
| getAll() {} | |
| } |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Net.NetworkInformation; | |
| using System.Net; | |
| namespace AvailablePort | |
| { | |
| class Program |
I've developed a useful feature in KeystoneJS that lets you populate a relationship from either side, while only storing the data on one side, and am looking for feedback on whether it is something that could / should be brought back into mongoose itself. (It might be possible to add as a separate package but I suspect there'd be too much rewriting of mongoose internals for that to be a good idea).
I've added this as an issue in mongoose for consideration: #1888 but am leaving this gist in place because the examples are easier to read.
I've used Posts and Categories as a basic, contrived example to demonstrate what I'm talking about here; in reality you'd rarely load all the posts for a category but there are other real world cases where it's less unreasonable you'd want to do this, and Posts + Categories is an easy way to demo it.
The built-in population feature is really useful; not just for
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user

