Right now im trying to find specific data in my mongodb using findOne().
I currently have:
CharData.findOne({
guildID: bot.guilds.cache.get(message.guild.id).id,
userID: user.id,
characters: [{
CharacterID: CharID
}]
}, (err, data) => {
if(err) console.log(err)
console.log(data)
})
Im trying to find the data in the characters
array and find the specific characterID. (CharID is args[1]).
I tried doing h-s 4f7aeb48-754d-4fe6-832c-5da616e7ea46 (characterID) and for some reason it just returned null
As I said, it just returned null
I don’t know what I did wrong. (I want to get the entire object of the character)