[SERVER-6693] Copy-pasting multi-line strings with arrays does not work in shell Created: 02/Aug/12  Updated: 11/Jul/16  Resolved: 06/Aug/12

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 2.2.0-rc1

Type: Bug Priority: Minor - P4
Reporter: Randall Hunt Assignee: Zhehao Mao
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-6732 V8 Scripting: Multiline JSON Arrays b... Closed
Related
related to SERVER-3994 Brace matching in mongo shell could b... Closed
Operating System: ALL
Participants:

 Description   

Just found that copy paste for arrays [] which do not have an element on the same line as their opening brace does not work.

Not sure if this is desired behavior. Example:

> ops = [
Wed Aug  1 02:00:38 SyntaxError: syntax error (shell):1
>     { op : "findOne" , ns : "test.foo" , query : { _id : 1 } } ,
...     { op : "update" , ns : "test.foo" , query : { _id : 1 } , update : { $inc : { x : 1 } } }



 Comments   
Comment by auto [ 06/Aug/12 ]

Author:

{u'date': u'2012-08-06T10:30:11-07:00', u'email': u'tad@tadmarshall.com', u'name': u'Tad Marshall'}

Message: Merge pull request #279 from zhemao/multiline

SERVER-6693 fix multiline list input in mongo shell
Branch: master
https://github.com/mongodb/mongo/commit/fe001e3bc4f4483c6b94643082c914aa36c09bef

Comment by auto [ 06/Aug/12 ]

Author:

{u'date': u'2012-08-03T13:15:17-07:00', u'email': u'zhehao.mao@gmail.com', u'name': u'Zhehao Mao'}

Message: SERVER-6693 fix multiline list input in mongo shell
Branch: master
https://github.com/mongodb/mongo/commit/f08a742aadb8036944f2843aaac7627e2a49e4fc

Comment by Zhehao Mao [ 03/Aug/12 ]

This is an issue with multiline input of lists in general. In isBalanced, we don't check to make sure square brackets are balanced. I've created a patch.

Comment by Ian Whalen (Inactive) [ 02/Aug/12 ]

[] fails, whereas () and {} both work.

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