level search

This commit is contained in:
oatmealine 2020-01-25 12:21:43 +03:00
parent 7bd647979d
commit 8d98eb7a00
No known key found for this signature in database
GPG Key ID: C4CB49CFAD721145
1 changed files with 3 additions and 1 deletions

View File

@ -4,7 +4,9 @@ module.exports = (app, db) : void => {
app.post('/aa/database/getGJLevels21.php', async (req, res) => {
let levelsString = '';
const levels = await db.collection('levels').find({})
const levels = await db.collection('levels').find({
$or: [{id: Number(req.body.str)}, {name: {$regex: `${req.body.str}`}}]
})
.toArray();
// TODO: searching