Why does mgo saves field names lowercased , is it possible to change that behavior ?

35 views
Skip to first unread message

parais...@gmail.com

unread,
Nov 22, 2016, 10:15:33 PM11/22/16
to mgo-users
Given a struct 


    type
Struct struct {
       
Field string
   
}




mgo will save the field Field in mongodb with a low case key "field" . Is is possible to change that behavior without using struct tags ? why was this decision taken at first place ? 


Gustavo Niemeyer

unread,
Jan 9, 2017, 7:18:19 AM1/9/17
to mgo-...@googlegroups.com
The rationale is that lowercasing is the most common pattern on MongoDB uses.

We can always change the behavior, but it takes some effort to do that in a compatible way.

--
You received this message because you are subscribed to the Google Groups "mgo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mgo-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages