0

When I imported a json file into mongodb, I got an error "Failed: error processing document #1: invalid character 'F' looking for beginning of value". I checked the content of the json file and found mongodb did not accept "False, True, None, none" values when importing.

For example, if a json is { 'has_issues': True, 'has_projects': True, 'has_downloads': False, 'has_wiki': None }, the True, False, None need to be replaced when successfully importing.

Do anyone know why such a situation happens? Many thanks.

Is there a way in mongodb to automatically converting non-json values (e.g. True, False, None, none) to json values (e.g., true, false, null)?

1 Answer 1

1

False, True, None or none are not JSON values.
http://www.json.org/json-fr.html

false, true and null are JSON values.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, I notice that. So the next question is if there exists a way in mongodb for automatically converting non-json values to json values when data importing.
AFAIK, not with MongoDB, you need to develop your own script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.