Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion UPGRADE7.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ Experienced while upgrading modules for Grails 7
### Cool New Features
- Hello Exterminator, Good by bugs! Lot's of things started working... and working well! For instance, use of controller namespaces now work seemlessly.
- Massive decoupling of dependencies and cleanup between modules.
- Works with Spring Security 6 out of the box. No plugin needed!
- Works with Spring Security 6 out of the box. No plugin needed!
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ trait InstantBsonConverter implements TemporalBsonConverter<Instant>, InstantCon

@Override
void write(BsonWriter writer, Instant value) {
writer.writeInt64(convert(value))
writer.writeDateTime(convert(value))
}

@Override
Instant read(BsonReader reader) {
convert(reader.readInt64())
convert(reader.readDateTime())
}

@Override
BsonType bsonType() {
BsonType.INT64
BsonType.DATE_TIME
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class InstantBsonConverterSpec extends Specification implements InstantBsonConve
void "test read"() {
given:
BsonReader bsonReader = Mock(BsonReader) {
1 * readInt64() >> 100L
1 * readDateTime() >> 100L
}

when:
Expand All @@ -56,11 +56,11 @@ class InstantBsonConverterSpec extends Specification implements InstantBsonConve
write(bsonWriter, instant)

then:
1 * bsonWriter.writeInt64(100L)
1 * bsonWriter.writeDateTime(100L)
}

void "test bson type"() {
expect:
bsonType() == BsonType.INT64
bsonType() == BsonType.DATE_TIME
}
}
12 changes: 12 additions & 0 deletions grails-doc/src/en/guide/upgrading/upgrading60x.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -557,4 +557,16 @@ tasks.withType(Test).configureEach {
tasks.withType(JavaExec).configureEach {
jvmArgs('-XX:+TieredCompilation', '-XX:TieredStopAtLevel=1', '-XX:CICompilerCount=3')
}
----

===== 12.24 MongoDB

`Instant` persistence switched from epoch milliseconds (BSON int64) to BSON DateTime (same BSON type as `java.util.Date`); `LocalDateTime` continues to be converted to BSON DateTime using the configured zone. If you currently using domain objects with property type `Instant`, you will need to convert them prior to upgrading. For more info, see https://github.com/apache/grails-core/pull/15111[#15111].

[source,javascript]
----
db.Example.updateMany(
{ created: { $type: "long" } },
[ { $set: { created: { $toDate: "$created" } } } ]
);
----
Loading