Microsoft迁移数据库工具不正确的字符错误

时间:2016-02-03 18:36:59

标签: json azure database-migration azure-cosmosdb

我正在尝试使用https://azure.microsoft.com/en-us/documentation/articles/documentdb-import-data/#Prerequisites将json文件上传到Azure DocumentDB。上传开始后,我收到此错误:

  

System.ArgumentException:显示的资源名称包含无效字符“/”。      在Microsoft.Azure.Documents.Client.DocumentClient.ValidateResource(资源资源)      在Microsoft.Azure.Documents.Client.DocumentClient.d__33.MoveNext()   ---从抛出异常的先前位置开始的堆栈跟踪结束---

我似乎无法找到关于此的文档或者我不知道在哪里看。我想就这意味着什么以及如何解决它提供一些指导。我的猜测是“/”是我文档中某处的无效字符,可能是第33行。

如果是指示的话,这是第33行的文件。

[
{
"name":"Cabinet De Lespinasse",
"accountid":2953,
"address":null,
"city":null,
"country":null,
"createdAt":null,
"heading":null,
"headingid":null,
"latitude":null,
"longitude":null,
"objectId":null,
"phonenumber1":null,
"website":null,
"display":null,
"email":null,
"aboutUs":"Education: Graduated from the Faculty of Law, State University of Haiti, 1983, Types of Practice: Established in 1877, the law office is specialized in intellectual property law for trademark and patent, insurance and commercial matters. Does not handle collection, Languages: Creole, French, English",
"Verified":false,
"Brands":null,
"Products":null,
"Services":null,
"Facebook":null,
"Instagram":null,
"googlePlus":null,
"Twitter":null,
"LinkedIn":null,
"Youtube":null,
"Pinterest":null,
"paymentMethods":null,
"languagesSpoken":null
 },

 {//<--This is line 33//
"name":"Cabinet Villejoint",
"accountid":2952,
"address":null,

更新

当我以下列格式上传一个对象时,上传成功。我在下面的@ larry评论中删除了日期字段。

{
  	"name": "Western Union Agence Belmart ",
  	"accountid": 2851,
  	"address": "Route de Tabarre,",
  	"city": "Port-au-Prince",
  	"country": "Haiti",
  	"heading": "Money Transfer Locations",
  	"headingid": 428,
  	"latitude": null,
  	"longitude": null,
  	"objectId": "0NM7Bav1Lp",
  	"phonenumber1": "+509 3859 6346",
  	"website": "http://868.ht",
  	"display": "Western Union Agence Belmart",
  	"email": null,
  	"aboutUs": null,
  	"Verified": false,
  	"Brands": null,
  	"Products": null,
  	"Services": null,
  	"Facebook": null,
  	"Instagram": null,
  	"googlePlus": null,
  	"Twitter": null,
  	"LinkedIn": null,
  	"Youtube": null,
  	"Pinterest": null,
  	"paymentMethods": null,
  	"languagesSpoken": null
  }

然而,当我有下面的第二个对象时,上传失败了。知道这里发生了什么吗?

  [{
    "name":"Western Union Agence Belmart ",
    "accountid":2851,
    "address":"Route de Tabarre,",
    "city":"Port-au-Prince",
    "country":"Haiti",
    "heading":"Money Transfer Locations",
    "headingid":428,
    "latitude":null,
    "longitude":null,
    "objectId":"0NM7Bav1Lp",
    "phonenumber1":"+509 3859 6346",
    "website":"http://868.ht",
    "display":"Western Union Agence Belmart",
    "email":null,
    "aboutUs":null,
    "Verified":false,
    "Brands":null,
    "Products":null,
    "Services":null,
    "Facebook":null,
    "Instagram":null,
    "googlePlus":null,
    "Twitter":null,
    "LinkedIn":null,
    "Youtube":null,
    "Pinterest":null,
    "paymentMethods":null,
    "languagesSpoken":null
  },
  {
    "name":"Western Union Agence Belmart ",
    "accountid":2853,
    "address":"Route de Tabarre,",
    "city":"Port-au-Prince",
    "country":"Haiti",
    "heading":"Money Transfer Locations",
    "headingid":428,
    "latitude":null,
    "longitude":null,
    "objectId":"0NM7Bav1Lp",
    "phonenumber1":"+509 3859 6346",
    "website":"http://868.ht",
    "display":"Western Union Agence Belmart",
    "email":null,
    "aboutUs":null,
    "Verified":false,
    "Brands":null,
    "Products":null,
    "Services":null,
    "Facebook":null,
    "Instagram":null,
    "googlePlus":null,
    "Twitter":null,
    "LinkedIn":null,
    "Youtube":null,
    "Pinterest":null,
    "paymentMethods":null,
    "languagesSpoken":null
  }]

谢谢。

1 个答案:

答案 0 :(得分:0)

显然正确答案是由@larry maccherone提供的,因为Azure Portal中的DocumentDb文档资源管理器只允许您一次上传一个json对象。我在文档中错过了它,或者它没有在那里说。然而,这是我经历的结果。谢谢,拉里。