0

How to create fields for filling in admin-bro when editing a record with dynamic key names that were not originally specified in the mongoose model schema, for further possible editing of these fields through the admin-bro interface ?

Model schema

const {Schema, model, Types} = require('mongoose');

const Session = new Schema({ data: {}, fields: {name:Schema.Types.Mixed, pit: String,} })

Row in collection

row = { data: {name:'test', pit:'test'}, fields: {name:'test', pit:'test'} }

data - this is create dynamical

fields - this is set in model schema

Example

Row Create new - example

{data: {unknown_name:'test', unknown_name1:'unknown text'}};
OR
{data: {test:'test', test1:'unknown text'}};
OR
{data: {piter:'name', pen:'surname'}};
OR
{data: {name:'piter', surname:'pen'}};

enter image description here

Need in AdminBro view set how on screen.

Data Name input Data Pit input

Im not know what set and...

TheEnd13
  • 1
  • 1

0 Answers0