Mongoose frissítve
This commit is contained in:
parent
79b54d6fb9
commit
966e240267
14
app.js
14
app.js
|
|
@ -552,19 +552,21 @@ app.post('/apiPostDailyReport/:apiKey',function(req,res){
|
|||
// Munka lista lekérése és szűrése AJAX CALL
|
||||
app.get('/filter', utils.ensureAuthenticated, async function(req, res) {
|
||||
//console.log(req.query.year.value);
|
||||
|
||||
const year=new RegExp("^"+req.query.year);
|
||||
const condition=new RegExp("^"+req.query.condition);
|
||||
|
||||
var query={
|
||||
$or:[
|
||||
{"megrendelo": { "$regex": req.query.condition, "$options": "i" }},
|
||||
{"megrendelo": { "$regex": condition, "$options": "i" }},
|
||||
{$and:
|
||||
[
|
||||
{"workDate": { "$regex": req.query.year, "$options": "i" }},
|
||||
{"title":{ "$regex": req.query.condition, "$options": "i" }}
|
||||
{"workDate": { "$regex": year, "$options": "i" }},
|
||||
{"title":{ "$regex": condition, "$options": "i" }}
|
||||
]
|
||||
},{$and:
|
||||
[
|
||||
{"workDate": { "$regex": req.query.year, "$options": "i" }},
|
||||
{"poNumber":{ "$regex": req.query.condition, "$options": "i" }}
|
||||
{"workDate": { "$regex": year, "$options": "i" }},
|
||||
{"poNumber":{ "$regex": condition, "$options": "i" }}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
"lightpick": "^1.6.2",
|
||||
"moment": "^2.29.1",
|
||||
"moment-range": "^4.0.2",
|
||||
"mongoose": "^5.11.19",
|
||||
"mongoose": "^5.13.5",
|
||||
"mongoose-auto-increment": "^3.0.1",
|
||||
"mongoose-increment": "^2.0.0",
|
||||
"multer": "^1.4.2",
|
||||
|
|
|
|||
Loading…
Reference in New Issue