我正在使用MongoDB和Node.js
我有Json文件这给错误。什么是错的?
[
{
_id: 537cb1913961c4580f895e2a,
status: 'pending',
added: WedMay21201417: 02: 27GMT+0300(EEST),
friend: {
_id: 537cb1913961c4580f895e2a,
salt: 'b1e017366f2fa7d9d3af832c24cddccd3b189ad2b41e99c8d9602aa08c5caee9',
hash: '691c7530ddd9bd0f00ae3429410b83e56a92219582e1fecdb35a0d814c732160923e75225a2b98fcdc5594100fddaee589edb66f33411ecc6f0e5ab8fec9cb077a502cba44d82b20b003ac18478ff76add4f69b0f250765e767d647d67b1c328816ddf7c877f46cc5de3d62169eb1e67fa752dd8386bfe4182a1168a60037476cab94699688dd34f83cf7388971b07ccbcbb31f16c5ecd016282a5f99af8f8e3be7ad97764e8cd06676d757bad4aa28b013f46af854a0c65ce2a83f8f2f76dc3239486fee686c25638836dce43c82c83bca7a7a610d95ba90a72b2cee7a0172472983cd49d1d914540432c2e9263ffda918c6bda8b5b8c1f441a6415a7eb836eba7f155bff39978ad65733c4037900e057c61e37e611c4bbf7e8eb7e7b23dd66f481802666cf9e40bb5d3da4ddd666a6007db2cbc92803c159b1edb86860d0dd0578a88a8327569ec127c40dc958bc58df04ecd763133af6d5d6b0df0c0cc529c402d27d9bfe245c53317435a6c1a8f2e89f9feaa1c81387c0fac51216da64a878c4c04e4503910bef6ab8072bcf89ed987bd58c44cdd9af435d94788a8122045a3e15692b5e417fb6598582941298cf84013c5f02debf7d50e54eb82e743434ff0a5f68ca05fadd26cbd36a3164c956a1f3f4e8f0d0317dbc8f3e27adaf8e31d21656ac3803430085493eba4d118ab36b9f5741e157e767793cb6128a8b3f71',
username: 'user1',
email: 'user1@g.com',
__v: 0
}
}
]
我使用了Jsonlint,错误是
Parse error on line 2:
[ { _id: 537cb1913961c45
--------------^
Expecting 'STRING', '}'
答案 0 :(得分:7)
JSON意味着键和字符串值的双引号:
{
"_id": "537cb1913961c4580f895e2a",...