Permalink
Browse files

Include event id when getting events.

  • Loading branch information...
1 parent e42488f commit 17bec5c0f08d1bc397bf87ef030c78b53993db55 @mbostock mbostock committed May 17, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/cube/event.js
View
5 lib/cube/event.js
@@ -5,7 +5,8 @@ var mongodb = require("mongodb"),
parser = require("./event-expression"),
tiers = require("./tiers"),
types = require("./types"),
- bisect = require("./bisect");
+ bisect = require("./bisect"),
+ ObjectID = mongodb.ObjectID;
var type_re = /^[a-z][a-zA-Z0-9_]+$/,
invalidate = {$set: {i: true}},
@@ -187,7 +188,7 @@ exports.getter = function(db) {
handle(error);
// A null event indicates that there are no more results.
- if (event) callback({time: event.t, data: event.d});
+ if (event) callback({id: event._id instanceof ObjectID ? undefined : event._id, time: event.t, data: event.d});
else callback(null);
});
});

0 comments on commit 17bec5c

Please sign in to comment.