Details
-
Improvement
-
Resolution: Unresolved
-
Minor - P4
-
None
-
None
-
None
-
Query Execution
Description
I get data from mongodb in php and display fields in table. But I get data not in the order I set in fields, for example, in sql database, one gets fields in the same order that are set in the list of fields.
$cursor = static::getMongoCollection(false)->find($query)->fields($fields);
For example it displays in the same order now matter if I use:
$fields = array("field1" => 1, "field2" => 1, "field3" => 1)
or
$fields = array("field3" => 1, "field2" => 1, "field1" => 1)
I need in my application to display fields in different order.