Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
291 views
in Technique[技术] by (71.8m points)

javascript - Mongo Node JS查询隐式$ and(Mongo node js query implicit $and)

It should only update and return results that have match on the request data.

(它仅应更新并返回与请求数据匹配的结果。)

it should be not mutually exclusive (ie if one query does not match then do not return result results)

(它不应互斥(即,如果一个查询不匹配,则不返回结果结果))

is using implicit $and a solution to that ?

(使用隐式$和解决方案?)

Query(询问)

  keystone.list('Vehicle').model.update({ $or: [{ Body: { $in: req.body.data[0].body } }, { Model: { $in: req.body.data[0].model } }, { Make: { $in: req.body.data[0].make } }, { Year: { $in: req.body.data[0].year } }] }, {
                    $set: {
                        'Summer_Sale_Event': req.body.summer_sale_value
                    }
                }, {
                    'multi': true
                }).exec(function (err, result) {

                });

Request data(索取资料)

Request : [ { body: [ 'Convertible' ],
    make: [ 'Chevrolet' ],
    year: [ '2005' ],
    model: [ 'Corvette' ] } ]
  ask by Mr. Mark Tawin translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...