appy-one / acebase

A fast, low memory, transactional, index & query enabled NoSQL database engine and server for node.js and browser with realtime data change notifications
MIT License
491 stars 27 forks source link

Add BigInt support #121

Closed Mitsichury closed 2 years ago

Mitsichury commented 2 years ago

Hi :)

I have noticed that if I add a BigInt field, I can't sort or apply filters on it. It is rightly stored and loaded. Could you add the support if BigInt for filtering please ? Could be great as JS does not handle big numbers with precision.

Thank you :)

appy-one commented 2 years ago

Your bigints now are stored as strings in the db, that's why they don't sort ok. I'm working on bigint support now, check latest commits

Mitsichury commented 2 years ago

Amazing, thx a lot 👍

appy-one commented 2 years ago

Support for bigint has now been implemented and published in v1.22.0!

Spread the word contribute Sponsor AceBase

Mitsichury commented 2 years ago

Hi appy-one, Thank you for publishing a new realese, I tried to update but it seems that add an Index on BigInt value is not working well. I have an error about JSON serialisation : TypeError: Do not know how to serialize a BigInt

const totalResults = await query.take(1000000).count()

I'll try to create a unit test for that. Thanks !