Its pretty straightforward to rename all the collections. I just wrote a simple python script to rename them. The issue Iām running into now is that previous collection links arenāt showing up. For example, if I have a āContent Linkā (previously āCollectionLinkā in V1) to a specific document in another collection it doesnāt show the content. It only shows a button āLink Collection Itemā which opens up a dialog to select the specific item, which is obviously not going to work for over tens of thousands of items.
Iāve copied over the same JSON options from V1 to V2, such as:
{
link: 'Customers',
display: 'Name',
multiple: true,
limit: false,
filter: null,
}
Iām wondering if the expected MongoDB structure has changed? For example, if I query a specific document in my collection I get:
{
_id: ObjectId("5db1e5206c11890231685138"),
Name: 'Part XYZ',
ShortName: 'XYZ',
CustomerSpecific: true,
Customer: [
{
_id: '5d262b2ff22765286848c965',
link: 'Customers',
display: 'Cockpit CMS'
}
],
...
}
When I load this specific document in the V2 Cockpit Admin interface Iām expecting to have a link ready to click saying āCockpit CMSā that takes me to the associated document.
Anyone aware of anything that has changed around the expected structure in MongoDB or JSON settings to get this to link correctly?
Showing view in admin interface
Showing settings of specific field item in the model
Edit 1: It looks like if I use the admin interface to make a new connection it updates the mongodb structure to:
Customer: { _model: 'Customers', _id: '5cdb2debf257657a85226862' }
Which means I need to write some scripts that look for all links and change them to _model in my collections. The last thing here I need to figure out is how to display the name of the linked item. In a forum search it looks like using a syntax similar to ${Name} in the Display input will solve the problem, but I still havenāt cracked the code.
Edit 2: It was in the documentation (kind of)! For me, Iām trying to show the āNameā field so modifying my JSON options to the below works:
{
link: 'Customers',
display: '${data.Name}',
multiple: true,
limit: false,
filter: null,
}
Removing the JSON options and only putting ${data.Name} in the Display field didnāt work.