Skip to content
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-14577): UUID #1067

Conversation

mohammadhunan-dev
Copy link
Contributor

@mohammadhunan-dev mohammadhunan-dev commented May 11, 2021

Pull Request Info

Jira

Staged Changes (Requires MongoDB Corp SSO)

Review Guidelines

REVIEWING.md

Copy link
Collaborator

@dacharyc dacharyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice example showing usage.

{+service-short+} has several types to represent groups of objects,
which we call **collections**. A collection is an object that contains
zero or more instances of one :ref:`{+service-short+} type
<node-object-types>`. {+service-short+} collections are **homogenous**:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you add mixed, this is not the complete history.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, I've removed the sentence "{+service-short+} collections are homogenous:
all objects in a collection are of the same type." now.

Also, note: this PR was supposed to be targeting 'new-data-types-node-rn', but was accidentally targeting 'master', which is why you see outdated changes to files unrelated to UUID. I've altered the target to 'new-data-types-node-rn' now.

A collection is **not** live when:

- it is a :ref:`results collection <node-realm-results>` that you are iterating through using a :mdn:`for..in <Web/JavaScript/Reference/Statements/for...in>` or :mdn:`for..of <Web/JavaScript/Reference/Statements/for...of>` statement. Both statements will continue to iterate through objects in the collection even if you have deleted or modified the collection's objects to exclude them from the filter that produced the results collection.
- the collection is a frozen :js-sdk:`Results.snapshot() <Realm.Collection.html#snapshot>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other Realm SDKs the word "frozen" means something different. A snapshot will preserved the length but the elements might mutate.

Copy link
Contributor Author

@mohammadhunan-dev mohammadhunan-dev May 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the following alternate phrasing be okay?:

"A collection is **not** live when: 

- ... {same first bullet as before}
-  the collection's length is preserved through a snapshot() but it's elements may be mutated."

Also, note: this PR was supposed to be targeting 'new-data-types-node-rn', but was accidentally targeting 'master', which is why you see outdated changes to files unrelated to UUID. I've altered the target to 'new-data-types-node-rn' now.

constraints and map more naturally to the denormalized :manual:`MongoDB document
model </core/data-modeling-introduction/>`.

Realm enforces unique ownership constraints that treat each embedded object as
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to be fancy, you can say it is a bijective mapping. Or you can say that it is an object with a property which is an object ({ a: { b: "c" } }).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to use examples in the docs that have more of a narrative, and can tell users what kind of use-cases they might use a specific feature for. For instance, the { a: { b: "c" } } doesn't tell a user what kind of data would be nested (other than the fact that 'b' is an object that is inside an object, a. However, the example below gives the user a specific narrative that they might be able to relate to or have a similar use case in their applications.

In addition, simply saying that embedded objects are objects that are a property of an object might give the readers the wrong impression that they do not have constraints, such as schema validation, when working with embedded objects.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's keep it short and clear. Using too much math will not make it easier for people to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mohammadhunan-dev mohammadhunan-dev changed the base branch from master to new-data-types-node-rn May 17, 2021 18:43
@mohammadhunan-dev mohammadhunan-dev merged commit 5f43200 into mongodb:new-data-types-node-rn May 18, 2021
mohammadhunan-dev pushed a commit that referenced this pull request May 19, 2021
* New data types node rn (#1040)

* new data types for node

* added data types to TOC

Co-authored-by: Mohammad Hunan Chughtai <mohammad.hunan@mongodb.com>

* fixed refs for node.js data types

* update doc

* Remove accidental changes

* added empty test file

* (DOCSP-15613): Added Node.js field types (#1041)

* Added node.js field types

* fixed wording

* fixed typo

* fix typo in mdn urls

* added additional data types

* fix monospace err

Co-authored-by: Mohammad Hunan Chughtai <mohammad.hunan@mongodb.com>

* (DOCSP-15613): Node.js collections type (#1044)

* Add content to Node.js > Data Types > Collections.txt

* Removed unneeded spacing

* clean up collections page + add headers

* Filled out collections page

* fix refs

* fix typo

* Update source/sdk/node/data-types/collections.txt

* Update source/sdk/node/data-types/collections.txt

* Update source/sdk/node/data-types/collections.txt

Co-authored-by: Dachary <dc@dacharycarey.com>

* fix rst

* fix woridng

* added ref

* removed unneeded word

* removed unneeded word

* added period

Co-authored-by: Mohammad Hunan Chughtai <mohammad.hunan@mongodb.com>
Co-authored-by: Dachary <dc@dacharycarey.com>

* (DOCSP-15613): Node.js embedded objects type (#1047)

* Added documentation of Node.js embedded objects under data types

* clean up relationships and embedded objects

* added CRUD examples for embedded obj

* added bluehawked examples

* fix rst syntax highlight + add description for deletes

* Update source/sdk/node/data-types/embedded-objects.txt

* Update source/sdk/node/data-types/embedded-objects.txt

* Update source/sdk/node/data-types/embedded-objects.txt

* Update source/sdk/node/data-types/embedded-objects.txt

* Update source/sdk/node/data-types/embedded-objects.txt

Co-authored-by: Mohammad Hunan Chughtai <mohammad.hunan@mongodb.com>

* Docsp 14569 mixed data type (#1064)

* attempt to add bluehawked mixed example snippets

* fixed wording

* Update source/examples/generated/node/data-types.codeblock.query-objects-with-mixed-values.js

* Update examples/node/Examples/data-types.js

Co-authored-by: Mohammad Hunan Chughtai <mohammad.hunan@mongodb.com>

* (DOCSP-14565): Dictionary data type (#1058)

* (DOCSP-14565): Dictionary Data Type - Node.js

* added unit tested + bluehawked dictionary examples

* Update examples/node/package.json

* removed unneeded file

* Added new examples for dictionaries

* update dictionary examples

* fix capitalization

* moved addlistener down

* fix comment

* update wording to be clearer on type usage in dict

* fix wording

* fix wording

Co-authored-by: Mohammad Hunan Chughtai <mohammad.hunan@mongodb.com>

* (DOCSP-14577): UUID (#1067)

* bump realmjs to 10.5.0-beta-1

* removed uuid as it's own page and added a subsection on it

* added uuid bluehawked snippet + readded uuid to toc

* added uuid examples

* removed uuid from field types as a paragraph

* update wording

* update wording

* fix passive voice

* add specific uuid example

* removed innacurate collections are homogenous (per mixed)

* (DOCSP-14573): set data type (#1079)

* added set examples + bluehawked

* literal included set exampkes

* added delete one set item example

* fix typo

* added descriptions to set

* fix grammar

* changed link + hunter to generic names

* added capitalization to clearly define Realm Set as a term

* fix wording + formatting"

* clarified wording

* fix literalincldue indentation

* fix typo

* more wording fixes

* clean up realm object model for set wording

* fix character names for examples

* clarified traversal order wording

* rst typo in <set>

* changed set to mySet

* fix overview wording

* updated overview to be more clear on differences between array

* updated create wording

* Update source/examples/generated/node/data-types.codeblock.remove-all-items-from-set.js

Co-authored-by: Kenneth Geisshirt <k@zigzak.net>

* Update source/examples/generated/node/data-types.codeblock.remove-specific-item-from-set.js

Co-authored-by: Kenneth Geisshirt <k@zigzak.net>

* Update source/sdk/node/data-types/sets.txt

Co-authored-by: Kenneth Geisshirt <k@zigzak.net>

* fix grammar + wording + changed Set to Realm.Set in js snippets

* Fix woridng

Co-authored-by: Kenneth Geisshirt <k@zigzak.net>

* fill out field types

* add react native data types as a copy of node data types

* add data types to toc

* fix rn mixed links

* attempt to add realm-js links

* more grammar and woridng fixes

* wording fixes

* Update source/sdk/node/data-types/uuid.txt

Co-authored-by: nate contino <nathan.contino@mongodb.com>

* change uuid note on rn to match node

* added note about obj id to both rn and node

* Update source/sdk/node/data-types/mixed.txt

Co-authored-by: nate contino <nathan.contino@mongodb.com>

* fix 'mixed' formatting on rn to match node

* change monospace to bold

* fix spacing errors

* fix wording

* correct supported types for mixed

* wording update

Co-authored-by: Mohammad Hunan Chughtai <mohammad.hunan@mongodb.com>
Co-authored-by: Dachary <dc@dacharycarey.com>
Co-authored-by: Kenneth Geisshirt <k@zigzak.net>
Co-authored-by: nate contino <nathan.contino@mongodb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants