-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
456 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"config_version": 20230101, | ||
"app_id": "6655920fc1ed444018db297b", | ||
"group_id": "64c37d22e47344686a325451", | ||
"client_app_id": "dynamic-data-fmzmcph", | ||
"last_pulled": 1717066261 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Dynamic data | ||
|
||
With the newly added ability to store collections in mixed properties, you can now store and synchronized | ||
data without pre-known schema. | ||
|
||
This app just holds a single data class that mixes strictly typed properties and a single mixed property | ||
that will be used as an entry point for the potentially deeply nested, dynamic data. | ||
|
||
The Kotlin UI shows each entity and associated 'configuration' mixed property in a tree view. There is | ||
currently no update options in the UI, so data has to be added through the Atlas UI in the | ||
"Data Service" section: | ||
|
||
![alt text](../../Screenshots/dynamic-data-browser.png "Atlas collection browser") | ||
|
||
Updates will be reflected in the Kotlin UI. |
3 changes: 3 additions & 0 deletions
3
AppServicesUsageSamples/apps/dynamic-data/auth/custom_user_data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"enabled": false | ||
} |
12 changes: 12 additions & 0 deletions
12
AppServicesUsageSamples/apps/dynamic-data/auth/providers.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"anon-user": { | ||
"name": "anon-user", | ||
"type": "anon-user", | ||
"disabled": false | ||
}, | ||
"api-key": { | ||
"name": "api-key", | ||
"type": "api-key", | ||
"disabled": true | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
AppServicesUsageSamples/apps/dynamic-data/data_sources/mongodb-atlas/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "mongodb-atlas", | ||
"type": "mongodb-atlas", | ||
"config": { | ||
"clusterName": "Cluster0", | ||
"readPreference": "primary", | ||
"wireProtocolEnabled": false | ||
}, | ||
"version": 1 | ||
} |
17 changes: 17 additions & 0 deletions
17
AppServicesUsageSamples/apps/dynamic-data/data_sources/mongodb-atlas/default_rule.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"roles": [ | ||
{ | ||
"name": "readAndWriteAll", | ||
"apply_when": {}, | ||
"document_filters": { | ||
"read": true, | ||
"write": true | ||
}, | ||
"insert": true, | ||
"delete": true, | ||
"search": true, | ||
"read": true, | ||
"write": true | ||
} | ||
] | ||
} |
19 changes: 19 additions & 0 deletions
19
...s/apps/dynamic-data/data_sources/mongodb-atlas/dynamic_data/DynamicDataEntity/schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"title": "DynamicDataEntity", | ||
"type": "object", | ||
"required": [ | ||
"_id", | ||
"name" | ||
], | ||
"properties": { | ||
"_id": { | ||
"bsonType": "objectId" | ||
}, | ||
"configuration": { | ||
"bsonType": "mixed" | ||
}, | ||
"name": { | ||
"bsonType": "string" | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
AppServicesUsageSamples/apps/dynamic-data/environments/development.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"values": {} | ||
} |
3 changes: 3 additions & 0 deletions
3
AppServicesUsageSamples/apps/dynamic-data/environments/no-environment.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"values": {} | ||
} |
3 changes: 3 additions & 0 deletions
3
AppServicesUsageSamples/apps/dynamic-data/environments/production.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"values": {} | ||
} |
3 changes: 3 additions & 0 deletions
3
AppServicesUsageSamples/apps/dynamic-data/environments/qa.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"values": {} | ||
} |
3 changes: 3 additions & 0 deletions
3
AppServicesUsageSamples/apps/dynamic-data/environments/testing.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"values": {} | ||
} |
1 change: 1 addition & 0 deletions
1
AppServicesUsageSamples/apps/dynamic-data/functions/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
4 changes: 4 additions & 0 deletions
4
AppServicesUsageSamples/apps/dynamic-data/graphql/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"use_natural_pluralization": true, | ||
"disable_schema_introspection": false | ||
} |
6 changes: 6 additions & 0 deletions
6
AppServicesUsageSamples/apps/dynamic-data/graphql/validation_settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"read_validation_action": "ERROR", | ||
"read_validation_level": "STRICT", | ||
"write_validation_action": "ERROR", | ||
"write_validation_level": "STRICT" | ||
} |
3 changes: 3 additions & 0 deletions
3
AppServicesUsageSamples/apps/dynamic-data/hosting/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"enabled": false | ||
} |
1 change: 1 addition & 0 deletions
1
AppServicesUsageSamples/apps/dynamic-data/https_endpoints/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "dynamic-data", | ||
"provider_region": "aws-eu-central-1", | ||
"deployment_model": "LOCAL" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"type": "flexible", | ||
"state": "enabled", | ||
"development_mode_enabled": true, | ||
"service_name": "mongodb-atlas", | ||
"database_name": "dynamic_data", | ||
"client_max_offline_days": 30, | ||
"is_recovery_mode_disabled": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...es/demo/src/main/java/io/realm/appservicesusagesamples/dynamicdata/DependencyInjection.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2024 Realm Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.realm.appservicesusagesamples.dynamicdata | ||
|
||
import io.realm.appservicesusagesamples.Demos | ||
import io.realm.appservicesusagesamples.dynamicdata.ui.DynamicDataViewModel | ||
import io.realm.appservicesusagesamples.presence.ui.UserStatusListViewModel | ||
import org.koin.androidx.viewmodel.dsl.viewModel | ||
import org.koin.dsl.module | ||
|
||
val dynamicDataViewModel = module { | ||
viewModel { | ||
DynamicDataViewModel( | ||
app = get(qualifier = Demos.DYNAMIC_DATA.qualifier), | ||
) | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...es/demo/src/main/java/io/realm/appservicesusagesamples/dynamicdata/DynamicDataActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2024 Realm Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.realm.appservicesusagesamples.dynamicdata | ||
|
||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import io.realm.appservicesusagesamples.dynamicdata.ui.DynamicDataScreen | ||
import io.realm.appservicesusagesamples.dynamicdata.ui.DynamicDataViewModel | ||
import io.realm.appservicesusagesamples.ui.theme.AppServicesUsageSamplesTheme | ||
import org.koin.android.scope.AndroidScopeComponent | ||
import org.koin.androidx.scope.activityRetainedScope | ||
import org.koin.androidx.viewmodel.ext.android.viewModel | ||
import org.koin.core.scope.Scope | ||
|
||
/** | ||
* Activity that hosts the views that would demo property level encryption. | ||
*/ | ||
class DynamicDataActivity : ComponentActivity(), AndroidScopeComponent { | ||
override val scope: Scope by activityRetainedScope() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
val viewModel: DynamicDataViewModel by viewModel() | ||
|
||
|
||
setContent { | ||
AppServicesUsageSamplesTheme { | ||
DynamicDataScreen( | ||
viewModel, | ||
) | ||
} | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...mo/src/main/java/io/realm/appservicesusagesamples/dynamicdata/models/DynamicDataEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright 2024 Realm Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.realm.appservicesusagesamples.dynamicdata.models | ||
|
||
import io.realm.kotlin.types.RealmAny | ||
import io.realm.kotlin.types.RealmObject | ||
import io.realm.kotlin.types.annotations.PersistedName | ||
import io.realm.kotlin.types.annotations.PrimaryKey | ||
import org.mongodb.kbson.BsonObjectId | ||
import org.mongodb.kbson.ObjectId | ||
|
||
class DynamicDataEntity: RealmObject { | ||
@PersistedName("_id") | ||
@PrimaryKey | ||
var id: ObjectId = BsonObjectId() | ||
|
||
var name: String = "<name>" | ||
|
||
var configuration: RealmAny? = null | ||
} |
Oops, something went wrong.