Waterline version: 0.13.x
Node version: 8.9.1
NPM version: 6.5.0
Operating system: ubuntu 16.04
For examples :
models.Task.find({type:'type1'}) or models models.Task.find({type:{$eq:'type1'} })
Queries in Mongodb :
command task command: find { find: "task", filter: { type: /^type1$/i }, projection: {} }
planSummary: IXSCAN { type: 1 } keysExamined:1612853 docsExamined:44 cursorExhausted:1 numYields:12615 nreturned:44 reslen:34028 locks:{ Global: { acquireCount: { r: 25232 } }, MMAPV1Journal: { acquireCount: { r: 12616 } }, Database: { acquireCount: { r: 12616 } }, Collection: { acquireCount: { R: 12616 } } }
protocol:op_query 3669ms
This request runs for more than 3 seconds. Equality is replaced by a regex. Why ????
The time is same with Robomongo.
I changed the regex expression by an equality in Robomongo.
The request lasted 300ms, so 10 times less
Hi @TottiFr! It looks like you may have removed some required elements from the initial comment template, without which I can't verify that this post meets our contribution guidelines. To re-open this issue, please copy the template from here, paste it at the beginning of your initial comment, and follow the instructions in the text. Then post a new comment (e.g. "ok, fixed!") so that I know to go back and check.
Sorry to be a hassle, but following these instructions ensures that we can help you in the best way possible and keep the Sails project running smoothly.
*If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact [email protected]
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 [email protected]
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 [email protected]
ok, fixed!
@TottiFr 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.
@TottiFr Thanks for bringing this up. I'm down to look at a pull request that adds this to sails-mongo (cc @luislobo)
Hey @TottiFr , we're moving all the Waterline issues to the main Sails repo support (balderdashy/sails). Thanks for all the efforts so far and feel free to update this as needed. Pull requests welcome!
I agree with @mikermcneil - feel free to submit a pull request with these changes for sails-mongo 馃憤
Possible duplicate of https://github.com/balderdashy/sails/issues/4752#issuecomment-283021600
@Marigold Appreciate the follow-up. Mike is open to look at a sails-mongo PR for this (be sure to cc @luislobo).
@johnabrams7 I don't think it's necessary, it is only happening for legacy versions of sails and fixing it would break the caseSensitive "feature". It can solved easily by setting caseSensitive to true in config/connections.js, e.g.
localMongoServer: {
adapter: 'sails-mongo',
host: '192.168.2.121',
port: 27017,
wlNext:{
caseSensitive: true,
},
database: 'wra' //optional
},
(see https://github.com/balderdashy/sails/issues/4752#issuecomment-283021600 for original post)
Most helpful comment
@johnabrams7 I don't think it's necessary, it is only happening for legacy versions of sails and fixing it would break the
caseSensitive"feature". It can solved easily by settingcaseSensitivetotrueinconfig/connections.js, e.g.(see https://github.com/balderdashy/sails/issues/4752#issuecomment-283021600 for original post)