$update = $col->update(array('_id' => 'test'), array('$push' => array('friends' => 1)), array('safe' => true, 'upsert' => true));
$test = $col->findOne(array('_id' => 'test'));
debug(compact('update', 'test'));
Does not work as expected.
I get (checking via RockMongo) :
{
"_id": "test",
"friends": {
"0": 1
}
}
I want/expect to have this :
{
"_id": "test",
"friends": [
1
]
}
Any ideas ? Thanks !