【发布时间】:2014-07-15 17:28:11
【问题描述】:
我正在尝试在集合中将给定字段设置为小写(使用 php)。我读了Update MongoDB collection using $toLower 并尝试使用db.myCollection.update({_id: e._id}, {$set: {UserName: e.UserName.toLowerCase() }(在php 中是$collection->update(['_id' => 'e._id'], ['$set' => [ 'field' => 'e.field.toLowerCase()']]); ),但它没有用。
还有其他方法还是我犯了一个错误?
【问题讨论】: