Skip to content

Instantly share code, notes, and snippets.

@garrettwilkin
Created September 2, 2012 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garrettwilkin/3594469 to your computer and use it in GitHub Desktop.
Save garrettwilkin/3594469 to your computer and use it in GitHub Desktop.
Bad Data Decision
I wrote this to standardize all the meta data that i wanted in my documents:
function Shlock(kind, method, url, data) {
this.kind = kind;
this.method = method;
this.url = url;
this.data = data;
this.time = new Date().toJSON();
};
Then I used it like this:
vis.on("mousedown", function() {
var self = this;
var point = mousePoint(self);
var pack = {};
pack.point = point;
pack.client = gClient;
var ev = new Shlock('web','point','/force-hcp1.html',pack);
socket.emit('point',{'shlock':ev});
restart();
});
But, pack is an object that has elements which are objects themselves.
And that makes filtering via Mongo's built in field filtering API not work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment