MongoDB\Driver\Cursor Gets the Result Set in the Form of an Associated Array?


During the upgrade process of php7, because the old extension is no longer supported, but can only be used. There are many differences between the two cursor objects. The cursor object of the old version returns an associative array with _id as the key after iteraor_to_array. Can the new version only return the digital indexed array? Is there any solution?

In useMongoDBDriverBulkWrite()Class progressInsertWhen operating, returnsoid=uniq_random_wordsThe object of the. This should be its key
During the query operation, the queried data will also be brought along.OidThis field comes out, and this can be used as the key in the associative array, right? ? I am also learning mongodb, if you verify that it is not what I said, forgive me.