gpt4 book ai didi

node.js - Cassandra Sails model.count() 有效但 model.find() 和 model.findOne() 无效

转载 作者:搜寻专家 更新时间:2023-10-31 23:47:31 29 4
gpt4 key购买 nike

我在使用 sails-cassandra 连接系统的 Sails 中有一个 Data 模型。数据。 Data.count({...}).exec() 返回 1,但 Data.find({...}).exec() Data.findOne({...}).exec() 返回以下错误信息:

Error (E_UNKNOWN) :: Encountered an unexpected error
ResponseError: Undefined name folder in selection clause
at FrameReader.readError (/Users/samuel/Apps/dataapp/node_modules/sails-cassandra/node_modules/cassandra-driver/lib/readers.js:276:13)
at Parser.parseError (/Users/samuel/Apps/dataapp/node_modules/sails-cassandra/node_modules/cassandra-driver/lib/streams.js:187:45)
at Parser.parseBody (/Users/samuel/Apps/dataapp/node_modules/sails-cassandra/node_modules/cassandra-driver/lib/streams.js:169:19)
at Parser._transform (/Users/samuel/Apps/dataapp/node_modules/sails-cassandra/node_modules/cassandra-driver/lib/streams.js:103:10)
at Parser.Transform._read (_stream_transform.js:179:10)
at Parser.Transform._write (_stream_transform.js:167:12)
at doWrite (_stream_writable.js:301:12)
at writeOrBuffer (_stream_writable.js:288:5)
at Parser.Writable.write (_stream_writable.js:217:11)
at Protocol.ondata (_stream_readable.js:540:20)
at Protocol.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Protocol.Readable.push (_stream_readable.js:126:10)
at Protocol.Transform.push (_stream_transform.js:140:32)
at Protocol.transformChunk (/Users/samuel/Apps/dataapp/node_modules/sails-cassandra/node_modules/cassandra-driver/lib/streams.js:75:8)
at Protocol._transform (/Users/samuel/Apps/dataapp/node_modules/sails-cassandra/node_modules/cassandra-driver/lib/streams.js:26:10)
at Protocol.Transform._read (_stream_transform.js:179:10)
at Protocol.Transform._write (_stream_transform.js:167:12)
at doWrite (_stream_writable.js:301:12)
at writeOrBuffer (_stream_writable.js:288:5)
at Protocol.Writable.write (_stream_writable.js:217:11)
at Socket.ondata (_stream_readable.js:540:20)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:538:20)

(event loop)
at RequestHandler.send (/Users/samuel/Apps/dataapp/node_modules/sails-cassandra/node_modules/cassandra-driver/lib/request-handler.js:128:11)
at Client._getPrepared (/Users/samuel/Apps/dataapp/node_modules/sails-cassandra/node_modules/cassandra-driver/lib/client.js:581:11)
at /Users/samuel/Apps/dataapp/node_modules/sails-cassandra/node_modules/cassandra-driver/lib/client.js:399:12
at fn (/Users/samuel/Apps/dataapp/node_modules/sails-cassandra/node_modules/async/lib/async.js:638:34)
at Immediate._onImmediate (/Users/samuel/Apps/dataapp/node_modules/sails-cassandra/node_modules/async/lib/async.js:554:34)
at processImmediate [as _immediateCallback] (timers.js:367:17)

最佳答案

这可能是构造返回属性的问题,因为 count() 不返回任何属性,而 find() findOne() 做。

我会查看您模型上的属性。添加和删​​除每一个,直到找到违规者。

关于node.js - Cassandra Sails model.count() 有效但 model.find() 和 model.findOne() 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33084155/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com