[CSHARP-3279] Validation on double type Created: 02/Dec/20 Updated: 27/Oct/23 Resolved: 18/Dec/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | BSON |
| Affects Version/s: | 2.11.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Pablo Echavarría. | Assignee: | Robert Stam |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
.net core, compass |
||
| Attachments: |
|
| Description |
|
Validation fails for double type when value ends in .0 it passes the validation for 10.1 but not for 10 for example, tested on compass, and .net core mongo db driver |
| Comments |
| Comment by Backlog - Core Eng Program Management Team [ 18/Dec/20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 03/Dec/20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I am unable to reproduce this using the C# driver. The C# driver works as expected. I used the following self-contained console test application:
Take a look at my repro and let me know if I am doing something different than you are. Regarding Compass, any issues in Compass should be reported as a ticket in the Compass Jira project: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 03/Dec/20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for clarifying that the type of validation you were referring to was $jsonSchema validation. I will attempt to reproduce this with the C# driver. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Pablo Echavarría. [ 02/Dec/20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The validation of the collection looks like:
The document to be inserted looks like this:
And as you can see it fails validation.
And an example that succeed validation looks like:
(note that document with ph: 1.0 is unable to be inserted).
This example was using mongodb compass, however is the same case for when I try with the c# mongodb client.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 02/Dec/20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for reporting this issue. Please provide a [minimal reproducible example https://stackoverflow.com/help/minimal-reproducible-example] to help us debug it. |