2013-08-14 1 views

답변

0

내 질문에 답해주세요. 내 게시물 당 : https://groups.google.com/forum/#!topic/meteor-talk/o_co6nRjoYU

Meteor가 MongoDB 드라이버를 1.3.7에서 1.3.17로 업그레이드했을 때 읽기 문제에 대한 캐스팅이 0.6.5에서 해결되었다고 생각합니다.

https://github.com/mongodb/node-mongodb-native/blob/master/HISTORY

:
1.3.13 2013-07-31 
- Added promoteLongs option for to allow for overriding the promotion of Longs to Numbers and return the actual Long. 

그리고 http://mongodb.github.io/node-mongodb-native/api-generated/db.html에서 :

Db() 
promoteLongs {Boolean, default:true}, when deserializing a Long will fit it into a Number if it’s smaller than 53 bits 

내가 확인했고 유성이 실제로 다시 번호를 받게 않습니다.

점을 고려 :

  • 는 ECMA에 따르면 : "모든 양과 음의 정수 그 크기는
  • 당신은 을 원하는 번호 형식에서 표현할 수없는 더 큰 53^2보다 유의 실제로 긴 경우에 숫자로 저장하는 몽고

... 우리는 이제 좋겠다. :)

+0

여전히 numberLong으로 명시 적으로 캐스트 할 수는 없습니다. git issue 1314 : https://github.com/meteor/meteor/issues/1314를 참조하십시오. –

0
var myValue = parseInt('13', 10); 
Finance.insert({ 
    stats: { 
     bal1: NumberLong(myValue) 
    } 
}); 

위의 방법으로 NumberLong()가 존재하는 한. Mongo는 문서에 따라 원하는 번호 유형을 지원합니다.

+1

DigiLord, NumberLong은 슬프게도 메서드로 존재하지 않으므로 오류가 발생합니다. –

관련 문제