Update: Add parameters to not update the timestamps of the document
This commit is contained in:
parent
00d991f8b1
commit
f91febf919
1 changed files with 2 additions and 2 deletions
|
|
@ -427,7 +427,7 @@ exports.ad = (req, res) => {
|
||||||
if(data.length > 0){
|
if(data.length > 0){
|
||||||
let ids = []
|
let ids = []
|
||||||
for(const i in data){ids.push(data[i]._id);}
|
for(const i in data){ids.push(data[i]._id);}
|
||||||
Ad.updateMany({_id: {$in: ids}}, {$push: {views: [new Date()]}})
|
Ad.updateMany({_id: {$in: ids}}, {$push: {views: [new Date()]}}, {timestamps: false})
|
||||||
.then(dataUpdate => {
|
.then(dataUpdate => {
|
||||||
if(dataUpdate && dataUpdate.modifiedCount > 0){
|
if(dataUpdate && dataUpdate.modifiedCount > 0){
|
||||||
return sendMessage(res, 11, data, token);
|
return sendMessage(res, 11, data, token);
|
||||||
|
|
@ -443,7 +443,7 @@ exports.ad = (req, res) => {
|
||||||
.then(data => {
|
.then(data => {
|
||||||
let ids = []
|
let ids = []
|
||||||
for(const i in data){ids.push(data[i]._id);}
|
for(const i in data){ids.push(data[i]._id);}
|
||||||
Ad.updateMany({_id: {$in: ids}}, {$push: {views: [new Date()]}})
|
Ad.updateMany({_id: {$in: ids}}, {$push: {views: [new Date()]}}, {timestamps: false})
|
||||||
.then(dataUpdate => {
|
.then(dataUpdate => {
|
||||||
if(dataUpdate && dataUpdate.modifiedCount > 0){
|
if(dataUpdate && dataUpdate.modifiedCount > 0){
|
||||||
return sendMessage(res, 11, data, token);
|
return sendMessage(res, 11, data, token);
|
||||||
|
|
|
||||||
Reference in a new issue