Home » Javascript » loopback3: issue with filter[where][property][eq]=string where string first digit is numerical

loopback3: issue with filter[where][property][eq]=string where string first digit is numerical

Posted by: admin August 19, 2018 Leave a comment

Questions:

I’ve been struggling with this.

I had this type of query working fine

/Accounts/:id/teams

Where

Account.teams: hasMany Team fk:ownerId
Team.owner: belongsTo Account fk: ownerId

in Account.json

"properties": {
  "id": {
    "type": "string",
    "id": true,
    "defaultFn": "guid"
  },

until the first letter of :id happened to be a numerical… because I used a table of accounts from a keystonejs app. Can’t generated guid have a numerical as first digit?

having same issue with filters, the only way around it I found was to use where: {ownerId: { regexp: “/^5dsd43$/” }

Am I missing something obvious?

Thanks

Answers: