用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1928|回复: 0
收起左侧

如何修改mongo数组中指定数组里的值

[复制链接]
发表于 2013-11-14 09:44:49 | 显示全部楼层 |阅读模式
mongo数组如下:
PHP复制代码
 
array (
  '_id' => new MongoId("5281d8fa942a88200e000000"),
  'uid' => new MongoInt32(3000001),
  'cardsBag' =>
  array (
    '0' =>
    array (
      'id' => new MongoInt32(3),
      'count' => new MongoInt32(1),
      'fightIndex' => new MongoInt32(6),
      'property' =>
      array (
        '0' => new MongoInt32(99),
        '1' => new MongoInt32(321),
      ),
    ),
    '1' =>
    array (
      'id' => new MongoInt32(110),
      'count' => new MongoInt32(1),
      'fightIndex' => new MongoInt32(1),
      'property' =>
      array (
        '0' => new MongoInt32(99),
        '1' => new MongoInt32(123),
      ),
    ),
    '2' =>
    array (
      'id' => new MongoInt32(98),
      'count' => new MongoInt32(1),
      'fightIndex' => new MongoInt32(-1),
      'property' =>
      array (
        '0' => new MongoInt32(99),
        '1' => new MongoInt32(234),
      ),
    ),
    '3' =>
    array (
      'id' => new MongoInt32(96),
      'count' => new MongoInt32(1),
      'fightIndex' => new MongoInt32(0),
      'property' =>
      array (
        '0' => new MongoInt32(99),
        '1' => new MongoInt32(432),
      ),
    ),
),)
复制代码


我想更改这个数组里的cardsBag里的第二个数组里面的值。update 要怎么写呢?

本版积分规则