[SERVER-5508] in query get mongodb fields in particular order in php (in the order we set in fields of query) Created: 05/Apr/12 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Oleg | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Execution
|
| Participants: |
| 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. |
| Comments |
| Comment by Tad Marshall [ 05/Apr/12 ] |
|
If by "obliterated" you mean the strikeout (like |
| Comment by Oleg [ 05/Apr/12 ] |
|
Could you please tell why >find($query) is obliterated? |