对象键后的字符无效 - geojson 中的对象键是什么?
Invalid character after object key - What is an object key in geojson?
我正在将以下文本文件导入 geojson:
{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{type":"LineString","coordinates":[[-122.029517,37.976152]]},"properties":{"name":"thing","origin":"somewhere","end":"blah"}}]}
mongoimport -vvv --db <db> --collection <collection-name> --file <file-name>
冗长的输出是:
<Date, etc> -0700 using 4 decoding workers
<Date, etc> -0700 using 1 insert workers
<Date, etc> -0700 filesize: 921 bytes
<Date, etc> -0700 using fields:
<Date, etc> -0700 connected to: localhost
<Date, etc> -0700 ns: <db>.<collection>
<Date, etc> -0700 connected to node type: standalone
<Date, etc> -0700 standalone server: setting write concern w to 1
<Date, etc> -0700 using write concern: w='1', j=false, fsync=false, wtimeout=0
<Date, etc> -0700 Failed: error processing document #1: invalid character '"' after object key
<Date, etc> -0700 standalone server: setting write concern w to 1
<Date, etc> -0700 using write concern: w='1', j=false, fsync=false, wtimeout=0
<Date, etc> -0700 imported 0 documents
如您所见,错误是invalid character '"' after object key
。然而,引号是必要的。有没有简单的解决方法?
type
一词的第三个实例似乎没有正确引用。如果您在该词之前添加双引号,您应该可以毫无问题地导入。
我正在将以下文本文件导入 geojson:
{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{type":"LineString","coordinates":[[-122.029517,37.976152]]},"properties":{"name":"thing","origin":"somewhere","end":"blah"}}]}
mongoimport -vvv --db <db> --collection <collection-name> --file <file-name>
冗长的输出是:
<Date, etc> -0700 using 4 decoding workers
<Date, etc> -0700 using 1 insert workers
<Date, etc> -0700 filesize: 921 bytes
<Date, etc> -0700 using fields:
<Date, etc> -0700 connected to: localhost
<Date, etc> -0700 ns: <db>.<collection>
<Date, etc> -0700 connected to node type: standalone
<Date, etc> -0700 standalone server: setting write concern w to 1
<Date, etc> -0700 using write concern: w='1', j=false, fsync=false, wtimeout=0
<Date, etc> -0700 Failed: error processing document #1: invalid character '"' after object key
<Date, etc> -0700 standalone server: setting write concern w to 1
<Date, etc> -0700 using write concern: w='1', j=false, fsync=false, wtimeout=0
<Date, etc> -0700 imported 0 documents
如您所见,错误是invalid character '"' after object key
。然而,引号是必要的。有没有简单的解决方法?
type
一词的第三个实例似乎没有正确引用。如果您在该词之前添加双引号,您应该可以毫无问题地导入。