Skip to content

Commit 9312a4b

Browse files
committed
remove sorting when synchronizing data.
1 parent 365d21d commit 9312a4b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/mongoosastic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ module.exports = function Mongoosastic(schema, options) {
262262
setIndexNameIfUnset(this.modelName);
263263

264264
//var stream = this.find(query, null, {timeout: false, batchSize: bulk.size}).sort('_id').read('secondaryPreferred').stream();
265-
var stream = this.find(query, null, {timeout: false, batchSize: bulk.size}).read('secondaryPreferred').stream();
265+
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.
266266

267267
stream.on('data', function (doc) {
268268
pending++;

0 commit comments

Comments
 (0)