Importing Json using DocumentDB Data Migration tool gives “Error while fetching page of documents code: 400” in CosmosDB

北战南征 提交于 2020-01-06 06:43:09

问题


Hi I am trying to import a Json file created using mongoexport into CosmosDB. I am using the DocumentDB migration tool which passes successfully and imports the collection into cosmos. When i try looking at the collection through cosmos DB i get the error code

Error while fetching page of documents: {"code":400,"body":"Command find failed: Unknown server error occurred when processing this request.."}

I am expecting the document to be view-able through Cosmos DB but am not sure why i am receiving this error code and am not able to see the entry.

The Json string i used ...

{
"_id": {
    "$oid": "5c5310e8dcaf3245045f5b13"
},

"Name": "Azure",
"Description": "CosmoDB",
"CurrentStatus": true,
"SObject": "\"\"",
"TheOption": ["5c5431f2dcrf34504525b14"],
"Settings": {
    "A": "Patched",
    "B": 100.0
},
"OtherKey": "ABC"
}

回答1:


You are importing data to a Mongo API account using Data Migration Tool.

In the official Data Migration Tool article, it states that:

Azure Cosmos DB's API for MongoDB - The Data Migration tool doesn't currently support Azure Cosmos DB's API for MongoDB either as a source or as a target.

Also:

If you want to migrate the data in or out of collections in Azure Cosmos DB, refer to How to migrate MongoDB data a Cosmos database with Azure Cosmos DB's API for MongoDB for instructions

So you need to follow the MongoDB migration instructions.

You can use the Data Migration Tool if the destination Cosmos DB account is SQL (Core) or Tables API accounts as stated in the docs.



来源:https://stackoverflow.com/questions/54594420/importing-json-using-documentdb-data-migration-tool-gives-error-while-fetching

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!