So I have a strapi cron job, and this is part of it:
const entity = await strapi
.query("registration")
.model.query((qb) => {
qb.where("created_at", ">", emailSendDate);
})
.fetch();
strapi.log.debug("entity", entity);
strapi.log.debug("entity type", typeof entity);
strapi.log.debug("entity email", entity["email"]);
strapi.log.debug("entity email", entity.email);
And then I get this response:
[2021-10-05T03:49:01.012Z] debug entity {"id":98,"email":"example_email@domain.com" ...
[2021-10-05T03:49:01.012Z] debug entity type object
[2021-10-05T03:49:01.012Z] debug entity email undefined
[2021-10-05T03:49:01.012Z] debug entity email undefined
Maybe I am not understanding something here, but shouldn't this be a plain Javascript object? Why am I getting undefined when trying to access the properties?