I want to store numbers like 09876 in mongoDb
I'm using php driver and so far I was casting my numbers to (int) , but I just noticed the numbers which starts with Zero , not saving in mongo properly and the zero drops !
So my numbers in mongo are like : NumberLong(9876) but it must be : NumberLong(09876)
So I know I can cast my numbers to String and save them exactly as they are , but is there a way beside this ?
I mean , I dont want to store numbers as Strings in mongo db
something like casting to char ???
Numbers are stored as values and any leading zeroes will ALWAYS be dropped in numeric fields. You have 2 options:
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다