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

Interger becomes double when updating document with mora. #40

Open
nifflin opened this issue Feb 3, 2016 · 1 comment
Open

Interger becomes double when updating document with mora. #40

nifflin opened this issue Feb 3, 2016 · 1 comment

Comments

@nifflin
Copy link

nifflin commented Feb 3, 2016

I wrote a json like {"a":10} into mongodb with mora, but the integer 10 becomes a double number 10.00 after writing. How to wrote a integer?

@nifflin nifflin changed the title Interger becomes double when updating document with mora? Interger becomes double when updating document with mora. Feb 3, 2016
@emicklei
Copy link
Owner

emicklei commented Feb 3, 2016

In JSON, numbers are double by default.
I wonder if what you see is related to mora, mgo the driver or mongo.
Perhaps https://golang.org/pkg/encoding/json/#Decoder.UseNumber should be used.
It needs investigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants