Skip to content

Update 3-project.mdx #51

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions docs/30-simple-queries/3-project.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ db.books.aggregate([
</Tabs>


- 1 means "show that field.". Once you started an inclusion projection you can't exclude other fields (you just keep adding the fields you want to see)
- 0 means "hide that field.". Once you started an exclusion projection you can't include other fields (you just keep adding the fields you don't want to see)
- 1 means, "Show that field." Once you start an inclusion projection, you can't exclude other fields. You just keep adding the fields you want to see.
- 0 means, "Hide that field." Once you start an exclusion projection, you can't include other fields. You just keep adding the fields you don't want to see.
- The primary key `_id` field is shown by default.

So we can exclude fields and show all fields except `attributes` using:
Expand Down