-
Type: Improvement
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Performance
-
None
Documents that the user inserts into the database are passed to the driver as `interface{}` types. This makes it tricky to detect if the `_id` field is already present (and to add it if necessary. Currently, we do this by marshalling the document into a byte slice and then unmarshalling that into a bson.M. This is inefficient, and it doesn't preserve order. We should implement a way to do this directly with a byte slice to avoid having to unmarshal into a bson.M.