Guest User

Untitled

a guest
Dec 18th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. I wrote this to standardize all the meta data that i wanted in my documents:
  2.  
  3. function Shlock(kind, method, url, data) {
  4. this.kind = kind;
  5. this.method = method;
  6. this.url = url;
  7. this.data = data;
  8. this.time = new Date().toJSON();
  9. };
  10.  
  11. Then I used it like this:
  12.  
  13. vis.on("mousedown", function() {
  14. var self = this;
  15. var point = mousePoint(self);
  16. var pack = {};
  17. pack.point = point;
  18. pack.client = gClient;
  19.  
  20. var ev = new Shlock('web','point','/force-hcp1.html',pack);
  21.  
  22. socket.emit('point',{'shlock':ev});
  23. restart();
  24. });
  25.  
  26.  
  27. But, pack is an object that has elements which are objects themselves.
  28. And that makes filtering via Mongo's built in field filtering API not work.
Add Comment
Please, Sign In to add comment