Every time I try and get any data from collection.entries i get an Undefined error. I have tried to get the data with collection.entires[1].data and it errors, attempting to define the variables leads to errors
what am I doing wrong?
import fetch from ‘cross-fetch’;
fetch(‘https://’, {
method: ‘post’,
headers: { ‘Content-Type’: ‘application/json’ },
body: JSON.stringify({
filter: { '_id': { $in: [1] } },
populate: 1, // resolve linked collection items
})
})
.then(res => res.json())
.then(collection => console.log(collection.entries[1].data));