[CDRIVER-1332] Does bson_json_reader_new's allow_multiple have an effect? Created: 16/Jun/16  Updated: 05/Dec/22  Resolved: 29/Oct/16

Status: Closed
Project: C Driver
Component/s: json, libbson
Affects Version/s: None
Fix Version/s: 1.5.0

Type: Task Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Unassigned
Resolution: Done Votes: 0
Labels: intern2016
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-4533 Docs for bson_new_from_json and bson_... Closed

 Description   

Investigate what allow_multiple is supposed to mean and whether it has an effect. Test and document the reality. This about parsing a buffer like:

{"a": 1}{"a": 1}{"a": 1}

Read the YAJL documentation to see what it's supposed to mean.

Could be that our error-handling code recovers when allow_multiple is false but we detect multiple docs, causing libbson to act as if allow_multiple is always true.



 Comments   
Comment by Githook User [ 29/Oct/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1332 note that allow_multiple is unused
Branch: master
https://github.com/mongodb/libbson/commit/9b105d772c99dc84d69387e3b21097267082605e

Comment by Githook User [ 29/Oct/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1332 always validate that JSON is UTF-8
Branch: master
https://github.com/mongodb/libbson/commit/21e6c0a6abf7461873b78ad596ed08388b442add

Comment by Githook User [ 29/Oct/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1332 whitespace
Branch: master
https://github.com/mongodb/libbson/commit/976896c086bcbea688b872151a36d47fdc34177f

Comment by Githook User [ 29/Oct/16 ]

Author:

{u'name': u'Fiona Rowan', u'email': u'fiona.rowan@10gen.com'}

Message: CDRIVER-1332: bson_json_reader_new, document allow_multiple effect
Branch: master
https://github.com/mongodb/libbson/commit/826ddb0217ae1d793fa2d98a1b9ce78978c53f60

Comment by Githook User [ 29/Oct/16 ]

Author:

{u'name': u'Fiona Rowan', u'email': u'fiona.rowan@10gen.com'}

Message: CDRIVER-1332: yajl config option bug fix
Branch: master
https://github.com/mongodb/libbson/commit/3751fda91ce3a0a6cb63f15bfb1f72bedfa78dd8

Comment by Hannes Magnusson [ 02/Sep/16 ]

https://github.com/mongodb/libbson/pull/175
https://github.com/mongodb/libbson/pull/176

Comment by A. Jesse Jiryu Davis [ 16/Jun/16 ]

Thanks Hannes. If the flag is necessary, then there's a problem with test coverage: I can edit bson_json_reader_new to always set allow_multiple=false and all the tests pass. Same if I always set allow_multiple true.

Comment by Hannes Magnusson [ 16/Jun/16 ]

This is to handle mongoexport -t json export files

Generated at Wed Feb 07 21:12:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.