Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.