Skip to content

Commit

Permalink
remove sorting when synchronizing data.
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghao1891 committed Dec 29, 2016
1 parent 365d21d commit 9312a4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongoosastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ module.exports = function Mongoosastic(schema, options) {
setIndexNameIfUnset(this.modelName);

//var stream = this.find(query, null, {timeout: false, batchSize: bulk.size}).sort('_id').read('secondaryPreferred').stream();
var stream = this.find(query, null, {timeout: false, batchSize: bulk.size}).read('secondaryPreferred').stream();
var stream = this.find(query, null, {timeout: false, batchSize: bulk.size}).read('secondaryPreferred').stream(); //remove sorting, because can't get all the data in some cases, maybe the version of mongodb, like v2.4.12.

stream.on('data', function (doc) {
pending++;
Expand Down

0 comments on commit 9312a4b

Please sign in to comment.