Currently in my meteor app, I am saving the unique id of the client within a collection named UserNavigationTracker:
{
"clientId" : "xxNfxxPGi7tqTbxc4",
"currentWizard" : "IntroductionWizard",
"currentStep" : "Step-1",
"_id" : "ifBJ688upEMfzzviC"
}
During the initialization of the app, it is essential for me to verify whether the client's information is already stored in the database. However, I am facing challenges when trying to retrieve this specific record from the collection. This is my current approach:
var clientIdInDatabase = UserNavigationTrackerCollection.find({"clientId": "xxNfxxPGi7tqTbxc4"});
console.log('clientIdInDatabase: ' + clientIdInDatabase);
The output displayed in the browser console is: clientIdInDatabase: [object Object]
My query now is: how can I access the actual value of the clientId field from the object returned by this search?