这是我的架构
var elementSchema = new Schema({
name: String,
storage: {
url: String,
type: String
}
});
但是,当我:
var newElement = new Element();
newElement.storage = {};
newElement.storage.url = "asd";
newElement.storage.type = "asd";
console.log(newElement.storage);
我明白[object Object]
了,虽然它应该返回{url:"asd",type:"asd"}
事实上,如果我去查询它,我会得到:
{
storage: "[object Object]",
bubble: ObjectId("510880b82e6e350200000002"),
_id: ObjectId("5113c0c0786ece0000000001"),
__v: 0
}