在mongoose中保存20 000个文档时出现MongoNetworkError

时间:2018-06-13 05:09:48

标签: node.js mongodb mongoose

我尝试使用Mongoose在mongo db中保存20 00个文档。我收到这个错误:

UnhandledPromiseRejectionWarning:未处理的承诺拒绝(拒绝ID:1):MongoNetworkError:连接0到localhost:27017超时

当我只保存一个文档时,我不会收到此错误。

这是我的代码:

[√] Flutter (Channel master, v0.5.5-pre.9, on Microsoft Windows [Version 10.0.16299.461], locale en-US)
    • Flutter version 0.5.5-pre.9 at C:\android-app\flutter
    • Framework revision 587569337e (7 hours ago), 2018-06-13 00:02:21 +0200
    • Engine revision a328531402
    • Dart version 2.0.0-dev.60.0.flutter-a5e41681e5

[!] Android toolchain - develop for Android devices (Android SDK 28.0.0)
    • Android SDK at C:\Users\Sreyah Admin\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.0
    • ANDROID_HOME = C:\Users\Sreyah Admin\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    X Android license status unknown.

[√] Android Studio (version 3.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[!] VS Code, 64-bit edition (version 1.24.0)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected devices (1 available)
    • XT1706 • HKE63YLL • android-arm • Android 6.0 (API 23)

请知道

感谢

1 个答案:

答案 0 :(得分:0)

使用坐标处理数据的新手和开发人员可能会遇到此问题。如果您有与上述主题有关的任何问题。您必须访问Mongodb网站https://docs.mongodb.com/manual/geospatial-queries以获得最新更新。