4 ms·
As an example alternative, Mongoose has versioning in its schemas. If you GET /product/12345, you'll receive the product info, along with its revision number, l
by joeframbach 12y ago
As an example alternative, Mongoose has versioning in its schemas. If you GET /product/12345, you'll receive the product info, along with its revision number, let's say this is revision 3. The user decides to buy the product, so they POST /orders with {productId:12345, __v: 3}. In the meanwhile, the store has updated the product, and Mongoose updates the revision to 4. Versions mismatch, send a 409.
http://aaronheckmann.tumblr.com/post/48943525537/mongoose-v3-part-1-versioning http://aaronheckmann.tumblr.com/post/48943525537/mongoose-v3...