Last active
November 25, 2023 15:43
-
-
Save bloggerklik/9d374d77935791280f09b3c6c1163194 to your computer and use it in GitHub Desktop.
Realm
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
// Step 1 ************************************************************************************* | |
// Current data | |
[ | |
{ | |
"id": "6407d4949096750f578c536c", | |
"name": "name1", | |
"modelB": [ | |
{ "label": "label1", "boolValue": true }, | |
{ "label": "label2", "boolValue": true }, | |
{ "label": "label3", "boolValue": true }, | |
* | |
//5000 pieces | |
{ "label": "label5000", "boolValue": true }, | |
] | |
}, | |
{ | |
"id": "7407d4949096750f578c536c", | |
"name": "name2", | |
"modelB": [ | |
{ "label": "label1", "boolValue": true }, | |
{ "label": "label2", "boolValue": true }, | |
{ "label": "label3", "boolValue": true }, | |
* | |
//5000 pieces | |
{ "label": "label5000", "boolValue": true }, | |
] | |
} | |
] | |
// Step 2 ************************************************************************************* | |
// useQuery("ModelA") | |
// Output | |
[ | |
{ | |
"id": "6407d4949096750f578c536c", | |
"name": "name1", | |
"modelB": [ | |
{ "label": "label1", "boolValue": true }, | |
{ "label": "label2", "boolValue": true }, | |
{ "label": "label3", "boolValue": true }, | |
* | |
//5000 pieces | |
{ "label": "label5000", "boolValue": true }, | |
] | |
}, | |
{ | |
"id": "7407d4949096750f578c536c", | |
"name": "name2", | |
"modelB": [ | |
{ "label": "label1", "boolValue": true }, | |
{ "label": "label2", "boolValue": true }, | |
{ "label": "label3", "boolValue": true }, | |
* | |
//5000 pieces | |
{ "label": "label5000", "boolValue": true }, | |
] | |
} | |
] | |
// Step 3 ************************************************************************************* | |
// What should be the query for the following output? | |
// Output | |
[ | |
{ | |
"id": "6407d4949096750f578c536c", | |
"name": "name1", | |
"modelB": [ | |
{ "label": "label3000", "boolValue": true }, | |
] | |
}, | |
{ | |
"id": "7407d4949096750f578c536c", | |
"name": "name2", | |
"modelB": [ | |
{ "label": "label3000", "boolValue": true }, | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment