I still can’t figure this out…
my mongoose model as a ref field:
const ThreadSchema = new Schema({
"board" : {
'type': mongoose.Schema.Types.ObjectId,
'ref': 'Board'
}
});
In a chai test, when I try to insert an object … it inserts all fields as expected EXCEPT the ‘board’ field. Does anyone know why?
.post('/api/threads/test')
.send(
{
boardTitle: 'test',
text:'POST - new thread - thread text',
delete_password:'123',
board: '5d9a41be671eb600c4609782' // also tried: ObjectId('5d9a41be671eb600c4609782')
})