简体   繁体   中英

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

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

Solved by getting rid of imported keystonejs accounts.id (it was a hexadecimal!)

Sorry for the noise

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM