所以,我的Mongo集合中有以下对象数组
[{
id: 1,
fields: {a:"1", b:"2", c:"3"}
},
{
id: 2,
fields: {a:"2", b:"3", d:"4"}
}]
并使用PHP我希望将其作为数组读取,因此Mongo中的空字段预先填充为空字符串,它看起来像这样
[{
id: 1,
fields: {a:"1", b:"2", c:"3", d:""}
},
{
id: 2,
fields: {a:"2", b:"3", d:"4", c:""}
}]
如果没有预处理字段对象并保存所有密钥,有没有办法做到这一点。