[CDRIVER-634] Allow setting max recursion depth at runtime Created: 05/May/15 Updated: 03/May/17 Resolved: 05/Dec/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | json, libbson |
| Affects Version/s: | None |
| Fix Version/s: | TBD |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | David Golden | Assignee: | Backlog - C Driver Team |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
BSON_MAX_RECURSION is a compiled in limit. As libbson is supposed to be a general-purpose library, hard-coding a limit (a MongoDB-specific limit, no less) makes it less flexible for other uses. |
| Comments |
| Comment by A. Jesse Jiryu Davis [ 05/Dec/16 ] |
|
Superseded by the requirements of the Extended JSON Spec, which requires 200 levels of JSON recursion. That spec also notes that the server only allows 100 levels of BSON recursion. Although libbson is not exclusively used for talking with MongoDB, it seems unlikely that supporting more deeply nested BSON documents than the server does will ever be a priority. |
| Comment by Jeremy Mikola [ 05/May/15 ] |
|
Other relevant constants (also hard-coded) are STACK_MAX (in bson-json.c) and, on a less related note, BCON_STACK_MAX (in bcon.h). |