mongodb unwated removal of an empty field on update

前端 未结 2 538
予麋鹿
予麋鹿 2021-01-24 03:24

Currently i run a mongo query that looks similar to the following:

$query = array(
    \'user_id\' => $this->getUserId(),
    \'name\'    => $this->g         


        
2条回答
  •  -上瘾入骨i
    2021-01-24 03:55

    Based off your problem, I would suggest re-trying "'created' => $this->getCreated() to the $query" provided your model has a created property defined, and your getter method is working, then this should use the current date on an insert, and the pre-set property value on update.

提交回复
热议问题