2
具有以下阵列:MongoDB关联数组 - 拉可能吗?
array(
'id' => 12,
'keys' => array('x1' => array('idx' => 12, 'text'=> '1123145'),
'x2' => array('idx' => 14, 'text'=> '1123142'),
'x3' => array('idx' => 12, 'text'=> '1123145'),
'x4' => array('idx' => 14, 'text'=> '1123145')
)
)
我想拉的所有按键与IDX 12.因此,我执行以下操作:
$mdb->db->collection->update(array('id' => 12), array('$pull' => array('keys' => array('idx' => 12))));
但它不工作,什么问题呢?
还有一种使用“$”操作符的方法。但我现在没有时间代表它。 – lig