Created
September 2, 2012 03:12
-
-
Save garrettwilkin/3594469 to your computer and use it in GitHub Desktop.
Bad Data Decision
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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