gpt4 book ai didi

windows - MongoDB Atlas mongoimport 问题无法将数组解码为 D

转载 作者:行者123 更新时间:2023-12-02 21:16:49 25 4
gpt4 key购买 nike

我是 mongoDB 新手,并且有一个免费的 Atlas 帐户。但是,我在 mongo 导入方面遇到问题。

系统:windows

>mongo --version
MongoDB shell version v4.2.0
git version: a4b751dcf51dd249c5865812b390cfd1c0129c30
allocator: tcmalloc
modules: none
build environment:
distmod: 2012plus
distarch: x86_64
target_arch: x86_64

mongoimport 字符串:

mongoimport --host Cluster0-shard-0/cluster0-shard-00-00-MY.mongodb.net:27017,cluster0-shard-00-01-MY.mongodb.net:27017,cluster0-shard-00-02-MY.mongodb.net:27017 --ssl --username MYUSER --password MYPASS --authenticationDatabase admin --db db --collection coll --type json --file D:\downloads\records.json

但我不断收到此错误:

2019-09-28T15:40:33.108-0600    WARNING: ignoring unsupported URI parameter 'replicaset'
2019-09-28T15:40:33.933-0600 connected to: mongodb://cluster...
2019-09-28T15:40:34.076-0600 Failed: cannot decode array into a D
2019-09-28T15:40:34.076-0600 0 document(s) imported successfully. 0 document(s) failed to import.

最佳答案

我刚刚想通了。我的文件中有一个 JSON 数组,为此,我必须附加

--jsonArray

记录在案here

使用提供的 URL。

关于windows - MongoDB Atlas mongoimport 问题无法将数组解码为 D,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58150528/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com