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.
我从 mongodb 获取 JSON 数据,当我提醒该变量时,它会将结果显示为“对象对象”。现在我想查看“对象对象”的确切值。我怎么能这样……?除了 JSON.stringify() 之外,任何人都可以提出解决方案......?
可以使用以下方法迭代用作关联数组的对象:
for (var key in thevar) { console.log(key + ": " + thevar[key]); }
这将产生如下输出:
_id: 793fdda7-3f2d-48c8-8e82-f2471f411d24 tag: example ram: 8kb