当我使用以下命令创建Collection :: View实例时
client = Mongo::Client.new('mongodb://127.0.0.1:27017/test')
view = client[:users].find( { name: "Sally" } )
=> #<Mongo::Collection::View:0x69824029475340 namespace='test.users' @filter={"name" => "Sally"} @options={}>
稍后如何更改此实例的filter
哈希?这不起作用:
view.filter.merge!("age" => 30)
=> #FrozenError: can't modify frozen BSON::Document