Answer the question
In order to leave comments, you need to log in
Why is the record not being inserted into Mongo?
Good afternoon.
Situation.
There is a user_data collection with fields login, key, value
Everything was ok. The data was inserted using the following method
$obj = self::model();
$obj->collection->update(array('login' => $login, 'key' => $key), array(
'$set' => array('value' => $value)
), array( 'upsert' => true));
But at one point, the records stopped inserting.
Tried doing this
$obj->collection->insert(array('login'=>$login, 'key'=>$key, 'value'=>$value));
But all the same records were not interposed. There were no mistakes.
If removed from the login array, then everything was inserted. Returned login and nothing was inserted.
Answer the question
In order to leave comments, you need to log in
Watched the load on the database at the time of failed inserts?
If you want it to actually insert, then add the safe:true option.
Without safe => true, you will never know the result of the paste.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question