Skip to content

DOCS-1318 change text for mongodb operations synonymous to alter table #814

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions source/includes/table-sql-to-mongo-schema-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,41 @@ sql2: |
ALTER TABLE users
ADD join_date DATETIME
mongo2: |
Collections do not describe or enforce the structure of the
constituent documents. See the :doc:`/core/data-modeling`
page for more information.
Collections do not describe or enforce the structure of its
documents; i.e. there is no structural alteration at the
collection level.

However, at the document level, :method:`update()
<db.collection.update()>` operations can add fields to existing
documents using the :operator:`$set` operator.

.. code-block:: javascript
:emphasize-lines: 1-5

db.users.update(
{ },
{ $set: { join_date: new Date() } },
{ multi: true }
)
ref2: |
See :method:`update() <db.collection.update()>` and
:operator:`$set` for more information on changing the structure
of documents in a collection.
See the :doc:`/core/data-modeling`, :method:`update()
<db.collection.update()>`, and :operator:`$set` for more
information on changing the structure of documents in a
collection.
sql3: |
.. code-block:: sql

ALTER TABLE users
DROP COLUMN join_date
mongo3: |
Collections do not describe or enforce the structure of its
documents; i.e. there is no structural alteration at the
collection level.

However, at the document level, :method:`update()
<db.collection.update()>` operations can remove fields from
documents using the :operator:`$unset` operator.

.. code-block:: javascript
:emphasize-lines: 1-5

Expand All @@ -81,8 +103,10 @@ mongo3: |
{ multi: true }
)
ref3: |
See :method:`update() <db.collection.update()>` and
:operator:`$unset` for more information.
See :doc:`/core/data-modeling`, :method:`update()
<db.collection.update()>`, and :operator:`$unset` for more
information on changing the structure of documents in a
collection.
sql4: |
.. code-block:: sql

Expand Down