[SERVER-3909] Blank lines don't work in the mongo shell starting with 2.0 Created: 20/Sep/11  Updated: 11/Jul/16  Resolved: 26/Sep/11

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.0.0
Fix Version/s: 2.0.1, 2.1.0

Type: Bug Priority: Major - P3
Reporter: Robert Stam Assignee: Antoine Girbal
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 64-bit


Backwards Compatibility: Major Change
Operating System: Windows
Participants:

 Description   

The following input (with a blank line) works in mongo shell prior to 2.0:

C:\mongodb\mongodb-win32-x86_64-1.8.2\bin>mongo
MongoDB shell version: 1.8.2
connecting to: test
> var doc =

{ ... a:1, ... ... b:2 ... }

> doc

{ "a" : 1, "b" : 2 }

>

But no longer works in mongo shell 2.0:

C:\mongodb\mongodb-win32-x86_64-2.0.0\bin>mongo
MongoDB shell version: 2.0.0
connecting to: test
> var doc =

{ ... a:1, ... ... b:2 > }

Tue Sep 20 12:59:57 SyntaxError: syntax error (shell):1
> doc
Tue Sep 20 12:59:59 ReferenceError: doc is not defined (shell):1
>



 Comments   
Comment by auto [ 09/Oct/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: SERVER-3909: Blank lines don't work in the mongo shell starting with 2.0
Branch: v2.0
https://github.com/mongodb/mongo/commit/17caecbd77d209202939107bbbaaf297692ac41e

Comment by auto [ 09/Oct/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: SERVER-3909: Blank lines don't work in the mongo shell starting with 2.0
Branch: v2.0
https://github.com/mongodb/mongo/commit/7f6640056249134fc00166eb7029d64d65b84768

Comment by Antoine Girbal [ 26/Sep/11 ]

there was a condition to bail out of multiline code in case 2 empty lines are entered.
But it had a bug and would disregard multiline if just 1 empty line was entered, applying 1 line later.
With fix, you can correctly exit multiline by entering 2 sequential empty lines.

Comment by auto [ 26/Sep/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: SERVER-3909: Blank lines don't work in the mongo shell starting with 2.0
Branch: master
https://github.com/mongodb/mongo/commit/11d51d22046e62728124e6827374e091d11f0965

Comment by auto [ 26/Sep/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: SERVER-3909: Blank lines don't work in the mongo shell starting with 2.0
Branch: master
https://github.com/mongodb/mongo/commit/6978f76e224b7d3711b697ed39398a1e940f2c81

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