-
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 40401 Node.js counter page #3313
DOCSP 40401 Node.js counter page #3313
Conversation
✅ Deploy Preview for device-sdk ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Readability for Commit Hash: de6920b 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.
Fantastic work on this so far! Let's review the feedback together
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.
Very nice updates Omar! Great seeing your contributions already. Left you some feedback and suggestions 👍
Counters cannot be used as: | ||
|
||
- Mixed values | ||
- Primary keys | ||
- Elements in a collection |
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.
Adding to the above suggestion:
To me the *cannot* store null values
becomes somewhat ambiguous as null
values can be stored (if they're declared nullable as you've written). Essentially, nullable counters can be null
in the db, which would make myObject.myCounter
return null
(thus, to access the potential value if the counter is not null, it'd be myObject.myCounter?.value
, requiring the ?
on the realm object counter property).
Co-authored-by: cbullinger <[email protected]>
Co-authored-by: cbullinger <[email protected]>
Co-authored-by: cbullinger <[email protected]>
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.
This is really close! Great job on the updates. A few things to address, and some suggestions to take or leave, and we should be good to go! 🚀
- The underlying value of the ``count`` is now ``1``, though it should be ``2`` to reflect | ||
both devices' increments. | ||
|
||
The ``Counter`` class makes it possible to sync these updates so the ``counter`` converges to |
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.
The ``Counter`` class makes it possible to sync these updates so the ``counter`` converges to | |
The ``Counter`` class makes it possible to sync these updates so the value converges to |
[nit] there's a lot of monospace formatting on the page. might be helpful to remove the ones that aren't really needed (esp if they're also the term counter
)
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 changed this instance from counter
to "value" to remove the monospace formatting and changed line 59ish to read "The property is initialized by using either:" instead of "The counter
field is initialized by using either:"
--------------------------- | ||
|
||
To initialize a counter, create your object using the ``realm.create()`` method. Pass in your | ||
desired :ref:`Realm Object Schema <node-define-a-realm-object-schema>` and initial counter |
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 it "the desired schema"? or the schema that contains the counter property?
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.
Heard -- I ended up just dropping the word "desired" from that sentence.
✨ Staging URL: https://preview-mongodbmongodb.gatsbyjs.io/realm/master/ 🪵 Logs |
Pull Request Info
Jira ticket: https://jira.mongodb.org/browse/DOCSP-40401
Note to Reviewer
Still fixing formatting, and currently only have code examples in typescript (javascript soon to come)
Creating a new JIRA ticket for pages that require an update as a result of this addition
Reminder Checklist
Before merging your PR, make sure to check a few things.
Release Notes
Review Guidelines
REVIEWING.md