[GODRIVER-111] Optimize checking for first bson document key starting with '$' Created: 27/Oct/17 Updated: 27/Oct/23 Resolved: 24/Jul/20 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Samuel Rossi (Inactive) | Assignee: | Unassigned |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
In order to correctly handle replace and update operations differently, we need to be able to check whether the first key in a document (interface{}) begins with '$'. Currently, we have to marshal the document into a byte slice and then unmarshal into a bson.D. This is very inefficient, so we should implement a more efficient method of doing this check. |