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-15613): Node.js embedded objects type #1047

Conversation

mohammadhunan-dev
Copy link
Contributor

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

Pull Request Info

Jira

Staged Changes (Requires MongoDB Corp SSO)

Review Guidelines

REVIEWING.md

@mohammadhunan-dev mohammadhunan-dev changed the base branch from master to new-data-types-node-rn May 6, 2021 19:49
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! Although the tip text did lead me to ask if we might want to add another example to this page.


You can use the same embedded object type in multiple parent object types, and
you can embed objects inside other embedded objects. You can even
recursively reference an embedded object type as an optional property in its
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm kind of fascinated by the idea of recursively referencing an embedded object type as an optional property in its own definition, but am having trouble visualizing a use case for it. I wonder if this might be a good example to add to the page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might look something like:

const AddressSchema = {
  name: "Address",
  embedded: true, // default: false
  properties: {
    street: "string?",
    city: "string?",
    country: "string?",
    postalCode: "string?",
    address: Address?
  },
};

Though that tip is copied over from the existing docs, and is a scenario we probably don't want to actually show in our docs since it's so unique that I can't think of a practical use-case. The tip does show the sheer flexibility of embedded objects though.

@mohammadhunan-dev mohammadhunan-dev merged commit b79ffbc into mongodb:new-data-types-node-rn May 11, 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 <[email protected]>

* 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 <[email protected]>

* (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 <[email protected]>

* fix rst

* fix woridng

* added ref

* removed unneeded word

* removed unneeded word

* added period

Co-authored-by: Mohammad Hunan Chughtai <[email protected]>
Co-authored-by: Dachary <[email protected]>

* (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 <[email protected]>

* 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 <[email protected]>

* (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 <[email protected]>

* (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 <[email protected]>

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

Co-authored-by: Kenneth Geisshirt <[email protected]>

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

Co-authored-by: Kenneth Geisshirt <[email protected]>

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

* Fix woridng

Co-authored-by: Kenneth Geisshirt <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: Dachary <[email protected]>
Co-authored-by: Kenneth Geisshirt <[email protected]>
Co-authored-by: nate contino <[email protected]>
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.

2 participants