Long integers in mongoose

566 views
Skip to first unread message

th...@pdxajax.com

unread,
Aug 29, 2011, 6:42:14 PM8/29/11
to Mongoose Node.JS ORM
Hi all —

Mongo provides for bigints via the "Long" type / casting function...
The mongo-db-native driver does too. However, the best we get with
Mongoose appears to be the normal JavaScript Number type. Please
correct me if I am wrong, but this would appear to be a problem if you
want to work with bigints, since normal JS numbers are IEEE 754. So,
do we necessarily lose precision if we want to use Mongoose?

Thanks
Chris

th...@pdxajax.com

unread,
Aug 29, 2011, 7:41:53 PM8/29/11
to Mongoose Node.JS ORM
OK I figured out that if I need arbitrary precision, I'll have to
store values as strings and use a bigint library. Fine... That said,
it would still be nice to be able to use the full 64 bit longs that
are provided for by the native mongo driver. Any plans for this?

On Aug 29, 6:42 pm, "morphchami...@gmail.com" <th...@pdxajax.com>
wrote:

Aaron Heckmann

unread,
Aug 30, 2011, 9:48:44 AM8/30/11
to mongoo...@googlegroups.com
interesting. we don't have plans for it but a pull request with tests included would be awesome!

--
http://mongoosejs.com
http://github.com/learnboost/mongoose
You received this message because you are subscribed to the Google
Groups "Mongoose Node.JS ORM" group.
To post to this group, send email to mongoo...@googlegroups.com
To unsubscribe from this group, send email to
mongoose-orm...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/mongoose-orm?hl=en



--
Aaron


Reply all
Reply to author
Forward
0 new messages