Skip to content

Commit

Permalink
When initializing oplog tailing, only read 'ts'
Browse files Browse the repository at this point in the history
This means we read less data (yay), but more importantly it means that
if the last entry contained custom EJSON types, we don't try to parse
them. This code gets called synchronously from the first
Meteor.Collection constructor, which can legitimately be before your
EJSON.addType call.

Fixes meteor#2018.
  • Loading branch information
glasser committed Apr 10, 2014
1 parent 5345a0c commit f63aeee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mongo-livedata/oplog_tailing.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ _.extend(OplogHandle.prototype, {

// Find the last oplog entry.
var lastOplogEntry = self._oplogLastEntryConnection.findOne(
OPLOG_COLLECTION, {}, {sort: {$natural: -1}});
OPLOG_COLLECTION, {}, {sort: {$natural: -1}, fields: {ts: 1}});

var oplogSelector = _.clone(self._baseOplogSelector);
if (lastOplogEntry) {
Expand Down

0 comments on commit f63aeee

Please sign in to comment.