Using Loopback "strictObjectIDCoercion": true findById not working

50 views
Skip to first unread message

Developer LS

unread,
Jun 18, 2018, 5:20:13 AM6/18/18
to LoopbackJS
Using Loopback "strictObjectIDCoercion": true 
findById and findOne{where:{_id:round_id} not working
but find with foreign key is working 
like find{where:{contest_id:contest_id}

Samrita Sen Bakshi

unread,
Jun 19, 2018, 3:08:08 AM6/19/18
to loopb...@googlegroups.com
Hey,
I have faced simillar issues.
You have to try couple of things here.
try this first:
findOne{where:{_id:round_id.toString()}

If this does not work:
then set
 "strictObjectIDCoercion": false

If both these solutions do not work then kindly look for the relations of the respective model,that can also be a problem.

--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/2ff28ddb-72c9-4ea2-b6af-7bf8d77ee191%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
Samrita Sen Bakshi
9962976959
Reply all
Reply to author
Forward
0 new messages