Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexing documents containing bson.ObjectId does not use value from TextMarshaler #1258

Open
mschoch opened this issue Jul 2, 2019 · 0 comments
Labels

Comments

@mschoch
Copy link
Contributor

mschoch commented Jul 2, 2019

The mapping logic only checks for the TextMarshaler interface of structs and pointers, but bson.ObjectId is type string.

The fix is to add another check when the underlying type is string, but in my opinion this is a bad idea right now. The reason is that for struct and pointer, there is no other obvious value for indexing, and combined with an explicit text field mapping, that is a very strong signal from the user expressing what they want. However, in this case we don't know that the user doesn't want to index the original string. I know people disagree, but I don't believe that the mere presence of TextMarshaler implies that that is the correct value for indexing.

@mschoch mschoch added the bug label Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant