[COMPASS-7306] Unrecognized expression '$toDouble' Compass with latest Community MongoDB Created: 06/Oct/23  Updated: 27/Oct/23  Resolved: 11/Oct/23

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

Type: Bug Priority: Major - P3
Reporter: Alan Graham Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: first-responder
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Windows Compass
MongoDB 3.6.3 Community on Ubuntu 18


Documentation Changes: Not Needed

 Description   

Problem Statement/Rationale

Installing the latest Compass 1.40.2 I cannot see any of my "indexes" because I get an error "Unrecognized expression '$toDouble'".  I don't think any of my indices have exceeded an int32 yet, but that doesn't seem to matter.  Happens for all tables.

Please be sure to attach relevant logs with any sensitive data redacted.
How to retrieve logs for: Compass; Shell

failed","attr":{"address":"10.10.0.2:27017","serverConnectionId":7,"duration":125,"commandName":"aggregate","failure":"Unrecognized expression '$toDouble'"}}
{{

Unknown macro: {"t"}

,"s":"E","c":"COMPASS-DATA-SERVICE","id":1001000058,"ctx":"Connection 0","msg":"Failed to perform data service operation","attr":{"op":"collectionStats","message":

Unknown macro: {"ok"}

,"ns":"nettica.devices"}}}}
{{

Unknown macro: {"t"}

,"s":"D1","c":"COMPASS-DATA-SERVICE","id":1001000029,"ctx":"Connection 0","msg":"Driver command succeeded","attr":{"address":"10.10.0.2:27017","serverConnectionId":4,"duration":134,"commandName":"aggregate"}}}}
{{

Unknown macro: {"t"}

,"s":"I","c":"COMPASS-DATA-SERVICE","id":1001000181,"ctx":"Connection 0","msg":"Running aggregate","attr":{"ns":"nettica.devices","stages":["$limit"]}}}}
{{

Unknown macro: {"t"}

,"s":"D1","c":"COMPASS-DATA-SERVICE","id":1001000029,"ctx":"Connection 0","msg":"Driver command succeeded","attr":{"address":"10.10.0.2:27017","serverConnectionId":5,"duration":159,"commandName":"find"}}}}
{{

Unknown macro: {"t"}

,"s":"I","c":"COMPASS-DATA-SERVICE","id":1001000060,"ctx":"Connection 0","msg":"Running find","attr":{"ns":"nettica.devices"}}}}
{{

Unknown macro: {"t"}

,"s":"D1","c":"COMPASS-DATA-SERVICE","id":1001000029,"ctx":"Connection 0","msg":"Driver command succeeded","attr":{"address":"10.10.0.2:27017","serverConnectionId":5,"duration":67,"commandName":"aggregate"}}}}
{{

Unknown macro: {"t"}

,"s":"I","c":"COMPASS-DATA-SERVICE","id":1001000181,"ctx":"Connection 0","msg":"Running aggregate","attr":{"ns":"nettica.devices","stages":["$indexStats","$project"]}}}}
{{

Unknown macro: {"t"}

,"s":"D1","c":"COMPASS-DATA-SERVICE","id":1001000030,"ctx":"Connection 0","msg":"Driver command failed","attr":{"address":"10.10.0.2:27017","serverConnectionId":4,"duration":66,"commandName":"aggregate","failure":"Unrecognized expression '$toDouble'"}}}}
{{

Unknown macro: {"t"}

,"s":"E","c":"COMPASS-DATA-SERVICE","id":1001000058,"ctx":"Connection 0","msg":"Failed to perform data service operation","attr":{"op":"indexes","message":

Unknown macro: {"ok"}

,"ns":"nettica.devices"}}}}
{{

Unknown macro: {"t"}

,"s":"D1","c":"COMPASS-DATA-SERVICE","id":1001000029,"ctx":"Connection 0","msg":"Driver command succeeded","attr":{"address":"10.10.0.2:27017","serverConnectionId":7,"duration":69,"commandName":"listIndexes"}}}}
{{

Unknown macro: {"t"}

,"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000135,"ctx":"AutoUpdateManager","msg":"Checking for updates ..."}}}
{{

Unknown macro: {"t"}

,"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000126,"ctx":"AutoUpdateManager","msg":"Update not available"}}}

Steps to Reproduce

  1. Install Compass 1.40.2.
  2. Connect to a MongoDB 3.6.3 Community DB
  3. Select a database, table, and click on Indexes

Expected Results

See the indexes page

Actual Results

Unrecognized expression '$toDouble'

Additional Notes

I'm not sure when this last worked, but I update fairly regularly.



 Comments   
Comment by Alan Graham [ 11/Oct/23 ]

I was on an unsupported configuration. I've since installed 7.0.2 on
Ubuntu 20.04 and the problem went away. Sorry to trouble you.

Comment by Basit Chonka [ 11/Oct/23 ]

This issue is a known concern in Compass, specifically when it is linked to a server version that is older than version 4. Compass recommends that the server version be at least 4.2, as indicated in the official documentation found here.

In the case of server version 5.0.9, it's important to note that the $toDouble aggregation operator is valid. We utilize this operator for calculating index usage. If you encounter an error related to this specific server version when using Compass, kindly provide us with the log file so that we can investigate and address the issue accordingly.
 

Comment by Le Roux Bodenstein [ 11/Oct/23 ]

The most recent change to that area is here: https://github.com/mongodb-js/compass/pull/4963 and that's in the latest beta which you can try from here: https://github.com/mongodb-js/compass/releases/tag/v1.40.3-beta.4

Although that's unlikely to make it work in 3.6.3 which is unsupported.

Comment by Le Roux Bodenstein [ 11/Oct/23 ]

There's only one place in Compass that uses $toDouble and it was added in may: https://github.com/mongodb-js/compass/pull/4311.

Comment by Le Roux Bodenstein [ 11/Oct/23 ]

Hello Alan

It is unclear to me: Are you getting this on 3.6.3 or 5.0.9 or both?

Comment by Alan Graham [ 06/Oct/23 ]

db version v5.0.9
Build Info: {
    "version": "5.0.9",
    "gitVersion": "6f7dae919422dcd7f4892c10ff20cdc721ad00e6",
    "openSSLVersion": "OpenSSL 1.1.1  11 Sep 2018",
    "modules": [],
    "allocator": "tcmalloc",
    "environment":

{         "distmod": "ubuntu1804",         "distarch": "x86_64",         "target_arch": "x86_64"     }

}

isn't 3.6.3... but isn't latest either.

Comment by PM Bot [ 06/Oct/23 ]

Hello alan@meshify.app, thank you for reaching out to us! The team will review your issue and get back to you soon as soon as possible.

Please review your issue to ensure you've included your environment details and have attached relevant logs (with any sensitive data redacted), so that we're best able to provide you a timely and thorough response. Thanks again!

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