[JAVA-1280] In JsonWriter, support writing BSON Int64 values as JSON numbers rather than $numberLong Created: 16/Jun/14 Updated: 09/Mar/17 Resolved: 09/Mar/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | JSON |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Ross Lawley | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 3 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
MongoDB 2.6 introduced support for the NumberLong data type in MongoDB Extended JSON using $numberLong. In strict mode, JsonWriter will write all Int64 values using $numberLong. But some applications will prefer to lose the type information and just writes them as JSON numbers. |
| Comments |
| Comment by Jeffrey Yemin [ 09/Mar/17 ] | |||||
|
Closing as won't fix, since | |||||
| Comment by Jeffrey Yemin [ 09/Mar/17 ] | |||||
|
In scope of
will output:
| |||||
| Comment by Jeffrey Yemin [ 03/Jan/17 ] | |||||
|
We plan to address this, probably in scope of | |||||
| Comment by guillaume dufour [ 03/Jan/17 ] | |||||
|
ok, so you can close it as unresolved ;o( | |||||
| Comment by Michael Gagnon [ 31/Aug/16 ] | |||||
|
This current functionality (among other things) breaks the upgrade path in Scala when moving from Casbah driver - which unfortunately is a hard requirement if one intends to migrate beyond Mongo 3.0. Was using toJson on documents fetched as input to a JSON => case class deserializer, and this format introduces unconsidered expectations which breaks that. My only current recourse seems to be sanitizing the document first by converting bson longs to bson strings or to otherwise hand-roll deserialization logic for all document types in my system. It's a fairly large increase in complexity | |||||
| Comment by guillaume dufour [ 31/Mar/16 ] | |||||
|
I try a PR on this | |||||
| Comment by Jeffrey Yemin [ 19/Jun/14 ] | |||||
|
I think that the driver should punt on this until
and once those flag(s) are defined the driver can expose corresponding flags. |