But when I try to access “user.services” I get undefined. I developing a application outside of MeteorJS and it uses the data from the users collection to authenticate users and the application is being developed using ReactJS and nodejs. Any suggestions on how can I do this ? Thanks in advance.
From what I understand, you’re not running this with meteor, but just nodejs with the promise based mongodb client I would guess, if that’s the case, then await should be fine… but if User is a Meteor collection, then you do not need to await for the result.
But when I try to extract data from the “services” field in that object like this “user.services” I get “undefined” in return. But you can see that the “services” field is there and it contains other objects. What might be causing this.
My question was to find out why I am getting undefined. Is “services” is some kind of secure key I might be wrong but I am trying to find out.
I read your question, but again you’re not using Meteor users or collection. If I understood correctly, you’re question is pertaining the usage of Mongoose ODM in a NodeJS environment outside of Meteor is that correct?
Yes that is correct. I am trying to find out if this is linked to any encryption that accounts-password might have added. to be honest I really doubt that.
Also I’m not really sure why you need the service field it is only used within Meteor accounts system (that’s why it’s not defined in the schema above).
Edit: sorry I mean the resume array, the service has the password, you can use the schema I’ve provided.
Yeah there is nothing special about the field and I think you might be right about the schema.
need the password. developing another application that will use our existing users which are registered through a MeteorJS application