Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Include event id when getting events.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed May 17, 2012
1 parent e42488f commit 17bec5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/cube/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}},
Expand Down Expand Up @@ -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);
});
});
Expand Down

0 comments on commit 17bec5c

Please sign in to comment.