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

Overwrite NaN field not working #704

Closed
boomfly opened this issue May 20, 2019 · 5 comments
Closed

Overwrite NaN field not working #704

boomfly opened this issue May 20, 2019 · 5 comments
Labels

Comments

@boomfly
Copy link

boomfly commented May 20, 2019

Suppose we have document:

import { Class } from 'meteor/jagi:astronomy'

Docs = new Mongo.Collection 'docs'

Doc = Class.create
  name: 'Doc'
  collection: Docs
  fields:
    someNumber: Number
newDoc = new Doc {
  someNumber: NaN
}
newDoc.save()

And we try to change someNumber field with not NaN value it does not changing:

doc = Doc.findOne newDocId
doc.someNumber = 10
doc.save()

doc = Doc.findOne newDocId
console.log doc.someNumber # Value still is NaN
@lukejagodzinski
Copy link
Member

Can you create reproduction repository?

@boomfly
Copy link
Author

boomfly commented May 20, 2019

@lukejagodzinski
Copy link
Member

@boomfly indeed there is a bug. It just uses $inc modifier for numbers instead of $set. It will be easy fix

@lukejagodzinski
Copy link
Member

@boomfly fixed in v2.7.2

@boomfly
Copy link
Author

boomfly commented May 20, 2019

@lukejagodzinski thanks!

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

2 participants