loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Count on `RoleMapping` results 0 always

Open jmimi opened this issue 9 years ago • 2 comments

Bug or Not!

When I count on RoleMapping the result is zero. Because principalId is string but mongodb connector considered it's to be an object-id. So I have to change RoleMapping settings as adding to that.

I couldn't find anything in documentation for strictObjectIDCoercion, I find that in source code at : here

Additional information

$ node -e 'console.log(process.platform, process.arch, process.versions.node)'
linux x64 7.0.0
$ npm ls --prod --depth 0 | grep loopback
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] 
├── [email protected] 

jmimi avatar Jan 16 '17 07:01 jmimi

It's related to v1.18 connector mongodb and maybe the strictObjectIDCoercion settings not present on roleMapping.json. You should see this issue https://github.com/strongloop/loopback-connector-mongodb/issues/327

pierreclr avatar Jan 16 '17 15:01 pierreclr

@pierreclr Thanks for reply. I test with mongodb connector version 3.0.0 too and still the problem exists. I override the RoleMapping settings and added strictObjectIDCoercion. And also I think that settings should be for a property not the model. Maybe we have some other properties which string yet. And I close this issue regarding to your open issue

jmimi avatar Jan 16 '17 16:01 jmimi