MongoDB Compass - document does not show field with Object ID referenced (Ref) from another collection

878 views Asked by At

In MongoDB, I have a field in a document that looks as shown below:

curOrg: { type: mongoose.Schema.Types.ObjectId, ref: "Org" },

This field is present and works as expected in my code, however, if I open the MongoDB Compass, the field is not present in the document.

Does anyone know why, or what do I need to do so the field does show in MongoDB Compass, please? Thanks!

1

There are 1 answers

0
Caesar Patel On BEST ANSWER

I figured what the issue is. The issue is NOT with MongoDB Compass, but actual mongoDB driver used by 'fawn' for transactions. In that, the fawn task update does not work when I 'add' a new field along with update couple of other fields. If I keep the 'add' a field task separate than update other fields, the field is added correctly, and it shows up correctly in MongoDB Compass.