[COMPASS-7154] compass mongosh console output is on multiple lines vs mongosh in terminal. Created: 29/Aug/23  Updated: 29/Aug/23  Resolved: 29/Aug/23

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: 1.39.3
Fix Version/s: No version

Type: Bug Priority: Minor - P4
Reporter: Thomas Luckenbach Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

running a javascript with print will write to multi-lines instead of each print on 1 line


Issue Links:
Duplicate
duplicates COMPASS-6378 Embedded mongosh output is spread ont... Open
Documentation Changes: Not Needed

 Description   

// long running query
for (i=1; i<=5; i++) {
start = new Date().getTime();
docs = db.customersIndexed.find({
//docs = db.customers.find({
'address.state': 'UT', 'gender': 'Female',
'dob':

{ '$gte': ISODate('1990-01-01'), '$lte' : ISODate('1990-12-31')}

,
'policies': { $elemMatch: {'policyType': 'life', 'insured_person.smoking': true }} });
n = docs.count();
//list = docs.toArray();
print( "matched: ", n, "time (ms): ", ((new Date().getTime())-start) );
}
matched:
57
time (ms):
104
matched:
57
time (ms):
122
matched:
57
time (ms):
54
matched:
57
time (ms):
56
matched:
57
time (ms):

-----VERSUS
Atlas atlas-r3h8gs-shard-0 [primary] RICH-QUERY> for (i=1; i<=5; i++) {
... start = new Date().getTime();
... docs = db.customersIndexed.find({
... //docs = db.customers.find({
... 'address.state': 'UT', 'gender': 'Female',
... 'dob':

{ '$gte': ISODate('1990-01-01'), '$lte' : ISODate('1990-12-31')}

,
... 'policies': { $elemMatch: {'policyType': 'life', 'insured_person.smoking': true }} });
... n = docs.count();
... //list = docs.toArray();
... print( "matched: ", n, "time (ms): ", ((new Date().getTime())-start) );
... }
(node:10829) [MONGODB DRIVER] Warning: cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead
(Use `node --trace-warnings ...` to show where the warning was created)

matched: 57 time (ms): 242
matched: 57 time (ms): 33
matched: 57 time (ms): 236
matched: 57 time (ms): 33
matched: 57 time (ms): 33



 Comments   
Comment by Rhys Howell [ 29/Aug/23 ]

Thanks for opening, tracking in COMPASS-6378

Generated at Wed Feb 07 22:45:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.