Searching for the _id in my database immediately returns undefined:
var test = Exemple.findOne({_id: test_id});
However, using the following code retrieves all data from the collection:
var test = Exemple.find({}).fetch()
The data includes:
{ _id: '17SRlRpRSzP339E41A',
creationIP: 'local',
state:
{ label: 'never connected',
date: Wed Mar 14 2018 12:20:08 GMT+0100 (CET) },
language: 'en',
batch: '9zLKCkvSAyxQ4jtDG7_32018',
creationDate: Wed Mar 14 2018 12:20:08 GMT+0100 (CET) } ]
I only need to extract the _id and store it in a variable like this:
var test = Exemple.findOne({_id: test_id});