使用PHP file_get_contents从JSON文件读取MongoDB _id

时间:2019-04-08 10:29:11

标签: php mongodb

我正在使用PHP读取JSON文件

json_decode(file_get_contents("URL".$fileName),true);

它读取了所有正确的数据

"mongoId":"5c9bae50a45f14398668fb03"

它是用json文件写入的MongoDb数据库的ID。

但是我在PHP中获得的值为

stdClass Object
(
    [timestamp] => 1553706576
    [machineIdentifier] => 10710102
    [processIdentifier] => 13579
    [counter] => 6880003
    [time] => 1553706576000
    [date] => 2019-03-27T17:09:36.000+0000
    [timeSecond] => 1553706576
)

为什么它会以这种格式转换值,以及如何从文件中获取“ 5c9bae50a45f14398668fb03”该值

文件部分在编辑器中的外观为

"someName":[{"mongoId":"5c9bae50a45f14398668fb03",...

0 个答案:

没有答案