We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
mongod --version
v4.0.8
go version
1.11.8
go env
Ubuntu 18.04.1 amd64
Upsert doens't work well with query where value is []byte.
Example: If I do an upsert with query := bson.M{"hash": hash} (hash [32]byte) in case of overwriting existing record. It says:
query := bson.M{"hash": hash}
Error: E11000 duplicate key error collection: xxx.yyy index: hash_1 dup key: { : \"0xc023e09ff5f2d764fd08bfb92907d2d60cbc76d5acb8c808a26c9ed91278b489\" }"
Only work if I change hash to its string format like this: query := bson.M{"hash": hash.Hex()} - Hex() convert [32]byte to string.
query := bson.M{"hash": hash.Hex()}
development
Haven't tried yet.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of MongoDB are you using (
mongod --version
)?What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
Upsert doens't work well with query where value is []byte.
Example:
If I do an upsert with
query := bson.M{"hash": hash}
(hash [32]byte) in case of overwriting existing record. It says:Only work if I change hash to its string format like this:
query := bson.M{"hash": hash.Hex()}
- Hex() convert [32]byte to string.Can you reproduce the issue on the latest
development
branch?Haven't tried yet.
The text was updated successfully, but these errors were encountered: