-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(DOCSP-35259) Add Map data type docs #3163
Conversation
Readability for Commit Hash: d50bd67 You can see any previous Readability scores (if they exist) by looking Readability scores for changed documents:
For Grade Level, aim for 8 or below. For Reading Ease scores, aim for 60 or above:
For help improving readability, try Hemingway App. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions but overall lgtm
`````````````````````````` | ||
|
||
You can add a ``RealmMap`` to your Realm Object schema by defining a property as | ||
type ``RealmMap<T>`` where ``T`` can be any :ref:`supported Realm data type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since keys must be strings, aren't you defining a RealmMap<String, T?>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, you're right!
|
||
Realm objects can contain maps of any supported data type. | ||
Realm uses the :flutter-sdk:`RealmList <realm/RealmMap-class.html>` data type | ||
to store the data. Map keys may not contain ``.`` or start with ``$``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is percent encoding a map key allowed in Dart? From Kotlin page
// Percent encode . or $ characters to use them in map keys
val mapKey = "Hundred Acre Wood.Northeast"
val encodedMapKey = "Hundred Acre Wood%2ENortheast"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so, but only in the values, not the keys.
I take it back. Tested and percent-encoding works in map keys.
RealmMap | ||
~~~~~~~~ | ||
|
||
Realm objects can contain maps of any supported data type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't each map a key-value pair? and only the mapped values can be non-string (i.e. any supported type)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. You're right. I've reworded this paragraph.
Co-authored-by: cbullinger <[email protected]>
✨ Staging URL: https://preview-mongodbmongodb.gatsbyjs.io/realm/master/ 🪵 Logs |
Pull Request Info
Jira ticket: https://jira.mongodb.org/browse/DOCSP-35259
Staged changes:
Reminder Checklist
Before merging your PR, make sure to check a few things.
Release Notes
Review Guidelines
REVIEWING.md
Animal Wearing a Hat