Home > database >  Java mongo how to implement the update record is automatically updated updateTime field to the curre
Java mongo how to implement the update record is automatically updated updateTime field to the curre

Time:09-23

As title, like mysql, can be specified when define fields:
The DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

CodePudding user response:

Without this can only write themselves into the update time

CodePudding user response:

As if can
https://stackoverflow.com/questions/37782251/auto-populate-date-in-mongodb-on-insert

CodePudding user response:

Need their new ObjectId (), then the inside of the extraction time, specific see https://blog.csdn.net/ThisWhoIam/article/details/86747450

CodePudding user response:

CurrentDate () or currentTimestamp ()
  • Related