当我使用php数组插入新文档时,文档将插入到已存在的文档之间。为什么?

时间:2015-05-18 09:19:45

标签: php mongodb

我有一个已经有一些文件的集合。现在,当我尝试使用关联数组从PHP插入新文档时,新文档将插入到现有文档之间。为什么不在现有文档的末尾插入。任何人都可以提供答案吗?

我的用于插入mongoDB的PHP代码片段:

$summaryFields = array("Acquisition" => array(
"Something_1" => array("Premium" => "1","Non-Premium" => "2"),
"Something_2" => array("Premium" => "3","Non-Premium" => "4"),
"Something_3" => array("Premium" => "5","Non-Premium" => "6"),
"Something_4" => array("Premium" => "7","Non-Premium" => "8"),
"Something_5" => array("Premium" => "9","Non-Premium" => "10")
)); 
$mongoConn->insert("my_collection", $summaryFields);

0 个答案:

没有答案