Logic confusion when querying data with mongodb
Hello, good morning, I have a problem and I don't know if the query is being performed correctly and this is the query code:
const matchingMethods = await PrecioXP.find({
skill: skill,
$or: [
{ $and: [{ startlevel: { $lte: minLevel } }, { endlevel: { $gte: minLevel } }] },
{ $and: [{ startlevel: { $lte: maxLevel } }, { endlevel: { $gte: maxLevel } }] },
{ $and: [{ startlevel: { $gte: minLevel } }, { endlevel: { $lte: maxLevel } }] }
]
}).sort({ method: 1 });
3 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Just like this image is giving me the results
And the code was being based to do it like this