Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Mongoid 文档中有一个哈希字段,就像< _id: 58a202d407953817ece2989c, d: {"a"=>"b", "c"=>"d"}>我想从中弹出键一样a,以便哈希文件只包含c如何在 mongoid 中执行此操作?
< _id: 58a202d407953817ece2989c, d: {"a"=>"b", "c"=>"d"}>
a
c
data = ..., d: {"a"=>"b", "c"=>"d"}, ... 如果 我们考虑 data.d.delete("a")
data = ..., d: {"a"=>"b", "c"=>"d"}, ...
data.d.delete("a")