[COMPASS-7383] db.getCollectionInfos doesnt get pipeline information Created: 30/Oct/23  Updated: 06/Nov/23  Resolved: 02/Nov/23

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

Type: Bug Priority: Minor - P4
Reporter: Gregory Vinopal Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS:
node.js / npm versions:
Additional info:


Issue Links:
Related
related to COMPASS-5342 Ability to set mongosh config propert... Open
Documentation Changes: Not Needed

 Description   

Problem Statement/Rationale

What is going wrong? What action would you like the Engineering team to take?

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

Steps to Reproduce

db.getCollectionInfos({name:'firstYears'})

[
  {
    name: 'firstYears',
    type: 'view',
    options: { viewOn: 'students', pipeline: [Array] },
    info: { readOnly: true }
  }
]

 

Expected Results

here is the output from shell

replset [direct: primary] test> db.getCollectionInfos({name:'firstYears'})
[
  {
    name: 'firstYears',
    type: 'view',
    options: {
      viewOn: 'students',
      pipeline: [ { '$match': { year: 1 } } ]
    },
    info: { readOnly: true }
  }
]

Actual Results

What do you observe is happening?

Additional Notes

MongoDB 7.0.0 Community

Compass Version 1.40.4 (1.40.4)



 Comments   
Comment by Sergey Petushkov [ 02/Nov/23 ]

Hey gregory.vinopal@mongodb.com! This is working as expected. The value is returned by the command, you can see it there in your example, just default inspect depth of the document hides it. You can see the value if you pick the value deeper in the returned value:

db.getCollectionInfos({name:'firstYears'})[0].options

Or use JSON.stringify to show the whole result:

JSON.stringify(db.getCollectionInfos({name:'firstYears'}), null, 2)

We have a related issue to allow inspectDepth config option in Compass (COMPASS-5342), but we've yet to prioritize it. You can follow this issue to get updates when it resolves

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