Skip to content

DOCS-4908 - mongorestore --filter tutorial removed #2199

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
19 changes: 0 additions & 19 deletions source/tutorial/backup-with-mongodump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,25 +176,6 @@ database, or you may consider the :option:`mongorestore --drop` option to drop e
collection from the database before restoring from
backups.

.. _backup-restore-filter:

Restore a Subset of data from a Binary Database Dump
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:program:`mongorestore` also includes the ability to a filter
to all input before inserting it into the new database. Consider the
following example:

.. code-block:: sh

mongorestore --filter '{"field": 1}'

Here, :program:`mongorestore` only adds documents to the database from
the dump located in the :file:`dump/` folder *if* the documents have a
field name ``field`` that holds a value of ``1``. Enclose the
filter in single quotes (e.g. ``'``) to prevent the filter from
interacting with your shell environment.

Restore Backups to Non-Local ``mongod`` Instances
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down