Observed behavior
I’m trying to display array of messages, in my collection it looks like this
In models/gptchats.ts message field have type Array<Object>
import Mongoose from ‘mongoose’;
interface GptChatsInterface {
dateOfUse: Date;
user: Mongoose.Types.ObjectId;
chatId: number;
messages: Array;
model: String;
}
const gptChatsSchema = new Mongoose.Schema({
dateOfUse: Date,
user: { type: Mongoose.Schema.Types.ObjectId, ref: ‘users’ },
chatId: Number,
messages: Array,
model: String,
}, {
timestamps: false,
});
export { GptChatsInterface, gptChatsSchema };
in .forestadmin-schema.json file message field look like this
{
"defaultValue": null,
"enums": [],
"field": "messages",
"integration": null,
"inverseOf": null,
"isFilterable": true,
"isPrimaryKey": false,
"isReadOnly": false,
"isRequired": false,
"isSortable": true,
"isVirtual": false,
"reference": null,
"type": [],
"validations": []
},
But in admin panel…
Expected behavior
I want the forest administrator to display messages like it does in mongo Compass.
Failure Logs
Context
-
Project name: LetAi
-
Team name: Operations
-
Environment name: Development
-
Agent (forest package) name & version:
“dotenv”: “^16.0.1”,
“@forestadmin/agent”: “^1.0.0”,
“@forestadmin/datasource-mongoose”: “^1.0.0”,
“mongoose”: “^6.10.3”
“nodemon”: “^2.0.12”,
“typescript”: “^4.9.4”,
“ts-node”: “^10.9.1”