Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-7154

compass mongosh console output is on multiple lines vs mongosh in terminal.

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • No version
    • Affects Version/s: 1.39.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      running a javascript with print will write to multi-lines instead of each print on 1 line
    • Not Needed

      // 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

            Assignee:
            Unassigned Unassigned
            Reporter:
            thomas.luckenbach@mongodb.com Thomas Luckenbach (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: