File tree Expand file tree Collapse file tree 5 files changed +27
-1
lines changed Expand file tree Collapse file tree 5 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 6
6
sure to update to ` io.objectbox:objectbox-android-objectbrowser:4.3.0 ` in ` android/app/build.gradle ` .
7
7
* Update ObjectBox database for Flutter iOS/macOS apps to 4.3.0.
8
8
For existing projects, run ` pod repo update ` and ` pod update ObjectBox ` in the ` ios ` or ` macos ` directories.
9
+ * External property types (via [ MongoDB connector] ( https://sync.objectbox.io/mongodb-sync-connector ) ):
10
+ add ` jsonToNative ` to support sub (embedded/nested) documents/arrays in MongoDB.
9
11
10
12
## 4.2.0 (2025-04-15)
11
13
Original file line number Diff line number Diff line change @@ -593,6 +593,19 @@ enum ExternalPropertyType {
593
593
/// Representing type: String
594
594
javaScript,
595
595
596
+ /// A JSON string that is converted to a native representation in the external
597
+ /// system.
598
+ ///
599
+ /// For example, a JSON object on the ObjectBox side (string) would be
600
+ /// converted to an embedded document in MongoDB.
601
+ ///
602
+ /// It depends on the external system what kind of JSON structures is
603
+ /// supported. For MongoDB, this is very flexible and allows (nested) objects,
604
+ /// arrays, primitives, etc.
605
+ ///
606
+ /// Representing type: String
607
+ jsonToNative,
608
+
596
609
/// A vector (array) of Int128 values.
597
610
int128Vector,
598
611
Original file line number Diff line number Diff line change @@ -258,6 +258,8 @@ int externalTypeToOBXExternalType(ExternalPropertyType type) {
258
258
return OBXExternalPropertyType .Bson ;
259
259
case ExternalPropertyType .javaScript:
260
260
return OBXExternalPropertyType .JavaScript ;
261
+ case ExternalPropertyType .jsonToNative:
262
+ return OBXExternalPropertyType .JsonToNative ;
261
263
case ExternalPropertyType .int128Vector:
262
264
return OBXExternalPropertyType .Int128Vector ;
263
265
case ExternalPropertyType .uuidVector:
Original file line number Diff line number Diff line change @@ -490,6 +490,9 @@ class EntityWithExternalType {
490
490
@ExternalName (name: 'my-mongo-rel' )
491
491
final mongoIdEntities = ToMany <EntityWithExternalType >();
492
492
493
+ @ExternalType (type: ExternalPropertyType .jsonToNative)
494
+ String ? externalJsonToNative;
495
+
493
496
EntityWithExternalType (this .mongoId, this .mongoUuid);
494
497
}
495
498
Original file line number Diff line number Diff line change 727
727
},
728
728
{
729
729
"id" : " 16:5931645853908059165" ,
730
- "lastPropertyId" : " 3:7670802129899081197 " ,
730
+ "lastPropertyId" : " 4:6250975810854368520 " ,
731
731
"name" : " EntityWithExternalType" ,
732
732
"externalName" : " my-mongo-entity" ,
733
733
"properties" : [
749
749
"type" : 27 ,
750
750
"externalType" : 102 ,
751
751
"externalName" : " my-mongo-uuid"
752
+ },
753
+ {
754
+ "id" : " 4:6250975810854368520" ,
755
+ "name" : " externalJsonToNative" ,
756
+ "type" : 9 ,
757
+ "externalType" : 112
752
758
}
753
759
],
754
760
"relations" : [
You can’t perform that action at this time.
0 commit comments