I am migrating from LoopBack 2 to 3.x. I have this piece of code in a boot script:
const rm = {
principalType: RM.USER,
principalId: userId.toString(),
roleId: roleId.toString(),
};
return RoleMapping.findOrCreate({ where: rm }, rm);
In Loopback 2.x it was behaving as expected, in 3.0 the findOrCreate always create a new instance.
I tried to update also just the loopback-datasource-juggler using version 2 but the problem apparently is in loopback 3.0 and not the juggler.
Additional information
darwin x64 6.10.0
Node v6.10.0
├── loopback@3.4.0
├── loopback-boot@2.23.0
├── loopback-component-explorer@4.1.1
├── loopback-component-model-diagram@0.3.0
├── loopback-component-storage@3.1.0
├── loopback-connector-mongodb@3.0.1
I am migrating from LoopBack 2 to 3.x. I have this piece of code in a boot script:
In Loopback 2.x it was behaving as expected, in 3.0 the findOrCreate always create a new instance.
I tried to update also just the loopback-datasource-juggler using version 2 but the problem apparently is in loopback 3.0 and not the juggler.
Additional information
darwin x64 6.10.0
Node v6.10.0
├── loopback@3.4.0
├── loopback-boot@2.23.0
├── loopback-component-explorer@4.1.1
├── loopback-component-model-diagram@0.3.0
├── loopback-component-storage@3.1.0
├── loopback-connector-mongodb@3.0.1