access findOne promise (_doc) properties in mongoose

PHOTO EMBED

Thu Apr 15 2021 20:31:52 GMT+0000 (Coordinated Universal Time)

Saved by @ali_alaraby ##mongoose ##node.js

let companyConfigs = (await CompanyConfigsModel.findOne({}, { _id: 0, enableMobileLogout: 1 })).toObject();

let prop1 = companyConfigs.property;
content_copyCOPY