Get db value
Archived 2 years ago
I
ItIzYe
Playing Custom Status
Verified
hi, ive got this code:
```js
await interaction.guild.members.cache.forEach(member => {
let memberXp = Level.findOne({userID: member.user.id});
const finMemberXp = memberXp.userID;
console.log(memberXp.userID)
});
```
and basically what i want is to go through every member.id of a server and check if there's a db entry for that id. But somehow when i print `member xp`
i get printed
```op: 'findOne',
options: {},
_conditions: { userID: '993985235870023794' },
_fields: undefined,
_update: undefined,
_path: undefined,
_distinct: undefined,
_collection: NodeCollection {
collection: Collection {
collection: [Collection],
Promise: [Function: Promise],
modelName: 'Level',
_closed: false,
opts: [Object],
name: 'levels',
collectionName: 'levels',
conn: [NativeConnection],
queue: [],
buffer: false,
emitter: [EventEmitter]
},
collectionName: 'levels'
```
which is part of a big json and somehow i can't access the userID. DOes somebody know any help?
