Reputation: 2478
I´m trying to add a document to my mongodb with mlab in heroku:
And the message I get is: "JSON Validation Error: We encountered an error while parsing your JSON. Please check your syntax (e.g. ensure you are using double quotes around both your field names and values) and try again."
Why? Thank you!
Upvotes: 0
Views: 2373
Reputation: 2845
It's probably the single quotes on your comments array.
Try replacing with:
"comments": [
{
"comment": "This is insane",
"author": "Matt Daemon"
}
]
Also as @rotemy said, you have any doubts if your JSON is valid, use a validator and you will be able to solve this kind of issues much faster
Upvotes: 1