@@ -48,6 +48,50 @@ changes between the current and upgrade versions. For example, if you
48
48
are upgrading the provider from v8.0 to v8.5, address all breaking changes from
49
49
the version after v8.0, including any listed under v8.5.
50
50
51
+ .. _entity-framework-breaking-changes-v8.3:
52
+
53
+ Version 8.30.0 Breaking Changes
54
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55
+
56
+ Version 8.3.0 of the {+provider-short+} introduces a breaking change that
57
+ corrects the handling of nullable properties configured with an alternative BSON
58
+ representation. In previous versions, configurations set by the
59
+ ``[BsonRepresentation]`` attribute or the ``HasBsonRepresentation()`` fluent API
60
+ were not applied.
61
+
62
+ You can take action to address this discrepency in one of two ways:
63
+
64
+ - If using the alternative BSON representation is not critical, remove the
65
+ configuration from your application before it starts.
66
+
67
+ - Alternatively, you can update the affected elments to the new representation.
68
+ As part of your upgrade process, use the ``updateMany`` method for each
69
+ affected MongoDB collection to rewrite any affected nullable properties or
70
+ elements into the desired BSON representation using the ``$convert``
71
+ operation.
72
+
73
+ For example, you can convert a ``dateOfBirth`` element in a collection named
74
+ ``people`` from a BSON ``date`` into BSON ``int`` as shown in the following
75
+ code:
76
+
77
+ .. code-block:: csharp
78
+
79
+ db.people.updateMany(
80
+ { dateOfBirth: {$type: "date" } },
81
+ [
82
+ { $set: {
83
+ dateOfBirth:
84
+ { $convert:
85
+ { input: "$dateOfBirth",
86
+ to: "int",
87
+ onNull: null
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ]
93
+ )
94
+
51
95
.. _entity-framework-breaking-changes-v8.2:
52
96
53
97
Version 8.2.0 Breaking Changes
0 commit comments