You can compare with for (i) meaning a loop:
var myobj0 = { symbols: { $in: ["#" + "AVAX"] } }
find('XDB, 'XCOLLECTION', myobj0).then(result => {
console.log("These are here", result)
for (i = 0; i < result.length; i++) {
console.log("IDS:" + result[i].id)
bot.sendMessage(result[i].id, message);
}
})
You can also define the strength to match (as in Regex, but more efficient, since MongoDB built in)
const find = async (dbName, collectionName, json) => {
try {
const collection = client.db(dbName).collection(collectionName);
const result = await collection.find(json).collation( { locale: 'en', strength: 2 }).toArray();
return result;
} catch (err) {
console.error(err);
}
}
Maybe you just want to compare some asset that is already built in too. Please check collations here on Mongo official manual
$inof course. Mongoose even has a helperQueryResult = PhoneProduct.find().where('brand').in(brands)