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

Floating point number is saved as Number - both in code & MongoDb command #691

Open
a4xrbj1 opened this issue Nov 10, 2018 · 3 comments
Open

Comments

@a4xrbj1
Copy link

a4xrbj1 commented Nov 10, 2018

We have the same problem (as this one #575), both within our code:

return Gedmatches.insert({ kit1, kit2, totalCm, created, notSharing: true });

and when using MongoDb insert directly:

db.gedmatches.insert({ kit1: 'SyVRzmvn4f', kit2: 'Syfq7mD3Nz', created: new Date(), updatedAt: new Date(), totalCm: 7.32, HIR: 1 })

In both cases it changes the field value to 7 in the doc instead of 7.32

There must be an easier way to allow floating point numbers!

Originally posted by @a4xrbj1 in https://github.com/jagi/meteor-astronomy/issue_comments#issuecomment-437563068

@lukejagodzinski
Copy link
Member

lukejagodzinski commented Nov 10, 2018 via email

@a4xrbj1
Copy link
Author

a4xrbj1 commented Nov 12, 2018

What info do you need?

The definition for this field is:

totalCm: {
type: Number,
optional: true,
},

@lukejagodzinski
Copy link
Member

You have to create reproduction repository. Without that it's hard to tell. When you will try to replicate this error on the smaller code base it will probably appear to be caused not by Astronomy but by something else

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