It feels like this is going a bit too far with the use of tags. If
you want to do field validation, you'll want more metadata associated,
so some richer representation would be interesting.
(...)
> I am not sure how "/c" would be treated by Json then (do they really
> mean letter or char "/" also comes in the above classification) .
As I mentioned previously, "/c" was a new concept introduced by
gobson, so JSON doesn't do anything with it at the moment.
> Similar way, can i use any special character (say ";" ) to skip
> treating the tag as field name in mgo and Json.
No, that won't work with gobson. We can introduce a flag to signal
that the text preceding the "/" should not be treated as a field name,
maybe. I'd like to see more details of how you'd use that first,
though.
--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/blog
http://niemeyer.net/twitter
Yes, JSON will only work with letters, digits, and underscore. We
can't do just that in BSON, though. There are many other valid
characters which are commonly used (e.g. $, -, etc) in key fields.
Not sure if we want to restrict the set of valid characters, will have
to think about it a bit more.
> Well whatever the case, I don't think it is a good practice to block
> the usage of tag .. It make sense to say "/" is reserved for mgo
> rather than there is no freedom for the user of mgo (do you think that
> practical for everyone).
We're not blocking but rather making good use of them. There's a
distinction there.
> Gustavo, me being a novice user, can you please explain a bit on "If
> you want to do field validation, you'll want more metadata
> associated". I don't know any other way t associate metadata to struct
> field.
Right, you'd have to do that with actual logic in your own
application. When doing validation, you'll want to start to associate
things like text size, text field length, etc. This is too much for
tags, IMO.
Yes, I understand your point, and I'll fix it somehow. Just thinking
about the right approach.