Skip to content

Commit 346bf33

Browse files
committed
a drop "column" example using $unset
1 parent 32db25a commit 346bf33

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

source/includes/table-sql-to-mongo-schema-examples.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,17 @@ sql3: |
7272
ALTER TABLE users
7373
DROP COLUMN join_date
7474
mongo3: |
75-
Collections do not describe or enforce the structure of the
76-
constituent documents. See the :doc:`/core/data-modeling`
77-
page for more information.
75+
.. code-block:: javascript
76+
:emphasize-lines: 1-5
77+
78+
db.users.update(
79+
{ },
80+
{ $unset: { join_date: "" } },
81+
{ multi: true }
82+
)
7883
ref3: |
7984
See :method:`update() <db.collection.update()>` and
80-
:operator:`$set` for more information on changing the structure
81-
of documents in a collection.
85+
:operator:`$unset` for more information.
8286
sql4: |
8387
.. code-block:: sql
8488

0 commit comments

Comments
 (0)