Open wizmea opened 5 years ago
Hi @wizmea! It looks like you missed a step or two when you created your issue. Please edit your comment (use the pencil icon at the top-right corner of the comment box) and fix the following:
As soon as those items are rectified, post a new comment (e.g. “Ok, fixed!”) below and we'll take a look. Thanks!
*If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact inquiries@sailsjs.com
Ok, fixed!
Sorry to be a hassle, but it looks like your issue is still missing some required info. Please double-check your initial comment and try again.
*If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact inquiries@sailsjs.com
Ok, fixed!
@wizmea Thanks for posting, we'll take a look as soon as possible.
For help with questions about Sails, click here. If you’re interested in hiring @sailsbot and her minions in Austin, click here.
Hi @wizmea sorry for the late reply. Were you able to resolve this issue? I was looking into your issue and compared it to the official docs It looks like there may be a chance that your formatting of your .where criteria needs to be changed a bit.
@wizmea what version of MongoDB are you running?
sails-mongo@1.0.1 depends on mongodb@2.2.25, which is compatible with MongoDB up to v3.4 only (the latest being v4.0).
See MongoDB Compatibility for reference.
This issue is fixed in sails-mongo: https://github.com/balderdashy/sails-mongo/commit/42f62c37fa767ae0ac91a97d4edc9b2e1e57b910
But the modification is still not published on npm, we need to wait for sails-mongo@1.0.2
@Tarrask - Thanks for the follow-up, I'll consult with the team on getting sails-mongo updated on npm.
Sails version: 1.1.0 Node version:v10.5.0 NPM version:6.1.0 DB adapter name: sails-mongo DB adapter version: 1.0.1 Operating system: MacOS
[X ] I am experiencing a concrete technical issue (aka a bug) with Sails (ideas and feature proposals should follow the guide for proposing features and enhancements (http://bit.ly/sails-feature-guide), which involves making a pull request). If you're not 100% certain whether it's a bug or not, that's okay--you may continue. The worst that can happen is that the issue will be closed and we'll point you in the right direction.
[x] I am not asking a question about how to use Sails or about whether or not Sails has a certain feature (please refer to the documentation(http://sailsjs.com), or post on http://stackoverflow.com, our Google Group (http://bit.ly/sails-google-group) or our live chat (https://gitter.im/balderdashy/sails).
[x] I have already searched for related issues, and found none open (if you found a related closed issue, please link to it in your post).
[x] My issue title is concise, on-topic and polite ("jst.js being removed from layout.ejs on lift" is good; "templates dont work" or "why is sails dumb" are not so good).
[x] I have tried all the following (if relevant) and my issue remains:
and finally...
I have problem with sum() using waterline with mongo adapter
Query
const amount = await RdvConsultation.sum('cost').where({ f_etablishment: data.id, payStatus: "PAID", createdAt: {'>=': firstDay, '<=': lastDay} })
Error { AdapterError: Unexpected error from database adapter: Internal error occurred while running (/Users/arcadius/taf/web/opensi/gomedical/gomedical-backend/node_modules/sails-mongo/node_modules/mongodb-core/lib/connection/connection.js:321:22)
at Socket.emit (events.js:182:13)
at Socket.EventEmitter.emit (domain.js:442:20)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at TCP.onread (net.js:635:20)
name: 'MongoError',
message:
'The \'cursor\' option is required, except for aggregate with the explain argument',
ok: 0,
errmsg:
'The \'cursor\' option is required, except for aggregate with the explain argument',
code: 9,
codeName: 'FailedToParse' }
sumRecords
. Got non-Error: { MongoError: The 'cursor' option is required, except for aggregate with the explain argument at Function.MongoError.create (/Users/arcadius/taf/web/opensi/gomedical/gomedical-backend/node_modules/sails-mongo/node_modules/mongodb-core/lib/error.js:31:11) at /Users/arcadius/taf/web/opensi/gomedical/gomedical-backend/node_modules/sails-mongo/node_modules/mongodb-core/lib/connection/pool.js:489:72 at authenticateStragglers (/Users/arcadius/taf/web/opensi/gomedical/gomedical-backend/node_modules/sails-mongo/node_modules/mongodb-core/lib/connection/pool.js:435:16) at Connection.messageHandler (/Users/arcadius/taf/web/opensi/gomedical/gomedical-backend/node_modules/sails-mongo/node_modules/mongodb-core/lib/connection/pool.js:469:5) at Socket.If you are the maintainer of "sumRecords", then you can change its implementation to solve the problem (Most of the time, the solution is just to throw an actual Error instance instead. Alternatively, if the goal was to indicate a particular exception, you could throw any of the special, reserved "exit signals"-- e.g. the code name of any of your defined exits besides "error" or "success"). Otherwise, please file a bug report with the maintainer, or fork your own copy and fix that.