These are chat archives for Automattic/mongoose

2nd
Apr 2015
Liam Mitchell
@LiamKarlMitchell
Apr 02 2015 02:15

Stumbled upon Object.observe today, could this be used in place of markModified when supported?
It could be an option on construction of the schema or model to observe.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe

Example:

var obj = { foo: 0, bar: 1 };
Object.observe( obj, function(changes) {
  console.log(changes);
} )

setInterval(function(){ obj.foo = Math.floor(Math.random()*10) },1000);
Liam Mitchell
@LiamKarlMitchell
Apr 02 2015 11:23
Made a way to do RPC with mongoose for some projects I am working on.
Basic RPC with mongoose
https://github.com/LiamKarlMitchell/mongoose_rpc