Breaker
Breaker

Reputation: 339

Stop MongoShell from print variable assignment

I'm running studio 3T and am attempting basic scripting in the intellishell. If I do a simple variable assignment like

var myString= "";
myString = "xyz";
mystring = "abc";

it prints "xyz" and "abc" to the console, any way I can prevent this? For further context, there are a few purpose print() statements in the script and all variable assignments are polluting the console.

Upvotes: 2

Views: 656

Answers (1)

Breaker
Breaker

Reputation: 339

Found the issue, that I thought I might share. If your statement is not within a function, it will print to the console. As soon as the assignment is within a function it does not, hope this helps someone out there.

Upvotes: 5

Related Questions