[SERVER-9663] JavaScript execution failure when querying docs with Native values Created: 13/May/13  Updated: 12/May/17  Resolved: 12/May/17

Status: Closed
Project: Core Server
Component/s: JavaScript, Shell
Affects Version/s: 2.6.8, 3.1.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Aaron Heckmann Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

In the shell run the following:

db.someCollection.insert({ _id: 0 name: String }) // no quotes around String
db.someCollection.find({ _id: 0 }) 

Output:

Mon May 13 12:02:41.878 JavaScript execution failed: SyntaxError: Unexpected identifier
Error: 16722 JavaScript execution failed: SyntaxError: Unexpected identifier

Participants:

 Description   

Natives can be stored but not returned by a query in the shell. Querying produces a "JavaScript execution" error.

Same problem with String, Number, Array, Date, Object, Error, Function, RegExp, Boolean.



 Comments   
Comment by Justin Cohler [ 12/May/17 ]

This issue has gone away in more recent versions of MongoDB with added JavaScript protection.

Generated at Thu Feb 08 03:21:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.