Closed SergeyJyravlev closed 7 years ago
What is your environment? Can you provide more details? I.e. node.js version, cassandra-driver version, any relevant code sample.
+-- sails-cassandra@0.12.8
| +-- async@2.1.5
| +-- long@3.2.0
| +-- mocha@3.2.0
| | +-- browser-stdout@1.3.0
| | +-- diff@1.4.0
| | +-- glob@7.0.5
| | | +-- fs.realpath@1.0.0
| | | +-- inflight@1.0.6
| | | +-- minimatch@3.0.3
| | | -- once@1.4.0 | | +-- growl@1.9.2 | | +-- json3@3.3.2 | | +-- lodash.create@3.1.1 | | | +-- lodash._baseassign@3.2.0 | | | | +-- lodash._basecopy@3.0.1 | | | |
-- lodash.keys@3.1.2
| | | | +-- lodash._getnative@3.9.1
| | | | +-- lodash.isarguments@3.1.0
| | | | -- lodash.isarray@3.0.4 | | | +-- lodash._basecreate@3.0.3 | | |
-- lodash._isiterateecall@3.0.9
| | -- supports-color@3.1.2 | |
-- has-flag@1.0.0
| +-- semver@5.3.0
| -- through2@2.0.3 |
-- readable-stream@2.2.6
| +-- buffer-shims@1.0.0
| +-- process-nextick-args@1.0.7
| -- util-deprecate@1.0.2
-- uuid-1345@0.99.6
This dependences installed with sails-cassandra 0.12.8
Cassandra version 3.0.0
Node.js version 5.11.0
I find this issue after execute findOne function for model.
Model.findOne({id: id}).then(function (item) {
console.log(item.state) // state: { low: 1, high: 0, unsigned: false },
})
I think I know where this problem is coming from. The old driver did not have its own Long
type and used the generic one.
Can you try chanhing line 9
in lib/utils.js
from:
Long = require('long');
to
Long = types.Long;
if this works I'll fix it properly and create a unit test for it.
Yes, this works. Please fix this asap, because the module is used for the project and this issue is critical. Please, specify when this issue is solved. Thank you!
I'll push the new version in about 12 hours. Traveling.
Thank you. I will be wait update.
Pushed to npm. Please verify.
It's work. Thank you!
👍
Hi!
`
}; if (value instanceof Array) { return value.map(cast); } else { return cast(value); } };
`
This part of code "value instanceof Long" doesn't work at all.
if (Long.isLong(value)){ ret = value.toNumber(); }
This condition is executed correctly.
sails-cassandra - version 0.12.8
Please, resolve this issue ASAP.
Thanks!