Просмотр исходного кода

BugFix: Avoid usint `cursor.snapshot()` in preparation for MongoDB version upgrade

Yuki Takei 5 лет назад
Родитель
Сommit
b96af73659
1 измененных файлов с 1 добавлено и 3 удалено
  1. 1 3
      src/server/service/export.js

+ 1 - 3
src/server/service/export.js

@@ -166,9 +166,7 @@ class ExportService {
     const collection = mongoose.connection.collection(collectionName);
     const collection = mongoose.connection.collection(collectionName);
 
 
     const nativeCursor = collection.find();
     const nativeCursor = collection.find();
-    const readStream = nativeCursor
-      .lean()
-      .stream({ transform: JSON.stringify });
+    const readStream = nativeCursor.stream({ transform: JSON.stringify });
 
 
     // get TransformStream
     // get TransformStream
     const transformStream = this.generateTransformStream();
     const transformStream = this.generateTransformStream();