[DOCS-13264] Docs for $lookup implies that 'let' variables are only accessible in a $expr Created: 05/Dec/19  Updated: 30/Oct/23  Resolved: 27/Jan/20

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Vlad Rachev (Inactive) Assignee: Jeffrey Allen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 4 years, 1 day ago
Epic Link: DOCSP-1769

 Description   

Description

If you go down to the 'let' section of the docs it says

To access the let variables in the pipeline, use the $expr operator.

This is only true inside $match. Other stages can use the let variable as part of any expression.

It would be better worded as something like:

Any stage in the pipeline can access the variable using the $$var syntax, except for $match, where it can only be accessed inside a $expr

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 11/Feb/20 ]

Author:

{'username': 'jeff-allen-mongo', 'name': 'jeff-allen-mongo', 'email': 'jeffrey.allen@10gen.com'}

Message: (DOCS-13264): Wording tweaks to let variable info
Branch: v4.2
https://github.com/mongodb/docs/commit/d434d9f01290452f2ca07af129926d16518729d4

Comment by Githook User [ 11/Feb/20 ]

Author:

{'username': 'jeff-allen-mongo', 'name': 'jeff-allen-mongo', 'email': 'jeffrey.allen@10gen.com'}

Message: (DOCS-13264): Clarify let variable behavior for lookup
Branch: v4.2
https://github.com/mongodb/docs/commit/b978ac2a66b0b0d02e5c8c00a2bad953b33ae89d

Comment by Githook User [ 27/Jan/20 ]

Author:

{'username': 'jeff-allen-mongo', 'name': 'jeff-allen-mongo', 'email': 'jeffrey.allen@10gen.com'}

Message: (DOCS-13264): Clarify let variable behavior for lookup
Branch: master
https://github.com/mongodb/docs/commit/58a0162b4583f3f570a3b735540d3beace07db50

Comment by Githook User [ 27/Jan/20 ]

Author:

{'email': 'jeffrey.allen@10gen.com', 'username': 'jeff-allen-mongo', 'name': 'jeff-allen-mongo'}

Message: (DOCS-13264): Clarify let variable behavior for lookup
Branch: v4.2
https://github.com/mongodb/docs/commit/b978ac2a66b0b0d02e5c8c00a2bad953b33ae89d

Generated at Thu Feb 08 08:07:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.