简体   繁体   English

如何在MongoDB文档中填充列表?

[英]How can I populate a list in a MongoDB document?

I want to populate within a loop a MongoDB document's list, without overwriting the existing entries of the list. 我想在一个循环中填充MongoDB文档的列表,而不会覆盖该列表的现有条目。 Something like python's append. 类似于python的追加。 Is there a command that does this? 是否有执行此操作的命令?

You can use $Push operator. 您可以使用$ Push运算符。 If you need advance check Modifiers also. 如果您需要提前检查修改器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM