Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
2.1.1
-
None
-
ALL
Description
$project allows insertion of new computed fields, however it doesn't seem to allow insertion of new literal fields.
{$project : {"newfield":"abc"}}
gives "errmsg" : "exception: field path references must be prefixed with a '$' (\"abc\""
It would be nice to not have to hack around it via:
{$project : {"newfield": {$add: ["abc",""]}}}
Possibly related to https://jira.mongodb.org/browse/SERVER-5762 and https://jira.mongodb.org/browse/SERVER-5782
Attachments
Issue Links
- duplicates
-
SERVER-5782 need a $literal operator to help prevent injection attacks
-
- Closed
-