[DOCS-1886] Redaction release notes for 2.5.2 has syntax errors Created: 05/Sep/13  Updated: 11/Jan/17  Resolved: 06/Sep/13

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: mongodb-2.6
Fix Version/s: 01112017-cleanup

Type: Task Priority: Minor - P4
Reporter: David Erickson Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 10 years, 23 weeks, 5 days ago

 Description   

http://docs.mongodb.org/manual/release-notes/2.6/#aggregation-pipeline-changes

Syntax in example has flaws:
db.test.aggregate(
{ $match: {} },
{ $redact: { $cond: [

{ $lt: [ '$level', 3' ] }

,
"$$CONTINUE",
"$$PRUNE" ]
}
}
)

Should be:
db.files.aggregate( [
{ $match: {} },
{ $redact: { $cond: [

{ $lt: [ '$level', 3 ] }

,
"$$CONTINUE",
"$$PRUNE" ]
}
}
] )



 Comments   
Comment by Sam Kleinman (Inactive) [ 06/Sep/13 ]

I've just pushed a fix to this issue. There are two issues: first, the 2.5.3 shell doesn't handle this class of syntax errors very well (and the 2.4.x shell gave a more clear error.) Second, there was an errant quote mark. It turns out that the implementation of the aggregate helper means that you can specify the pipeline stages as either a sequence of arguments to the helper or as an array.

We've removed the errant single quote, and will work on improving the error reporting for the shell.

Comment by auto [ 06/Sep/13 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-1886: fixing syntax error
Branch: master
https://github.com/mongodb/docs/commit/0649943e0e0dc08ff0cc7cd2a1624061daf65cd5

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