问题
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