The problem is your customer id is being stored as a string in your database, but loopback is converting it to a BSON type, and BSON !== string.
Loopback detects BSON types by testing if it satisfies a RegEx of 24 alpha-numeric characters. If it does, then your '59ccd23ed23cf02ac4fa3a07' is being converted to a BSON.
We had this problem too. 3 solutions:
(1) save your csutomer_id as a BSON type, not a string
(2) Add an underscore to your customer_id to break the RegEx: '_59ccd23ed23cf02ac4fa3a07'. This solution isn't the best because you then have to override every CRUD function to append the underscore to the string
(3) add your customer Id as a relationship:
"relations": {
"customer":{
"type": "belongsTo",
"model": "User",
"foreignKey": "customer_id"
}
"member":{
"type": "belongsTo",
"model": "User",
"foreignKey": "member_id"
}
}