瀏覽代碼

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

Yuki Takei 5 年之前
父節點
當前提交
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 nativeCursor = collection.find();
-    const readStream = nativeCursor
-      .lean()
-      .stream({ transform: JSON.stringify });
+    const readStream = nativeCursor.stream({ transform: JSON.stringify });
 
     // get TransformStream
     const transformStream = this.generateTransformStream();