question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide API for `concat()`

See original GitHub issue

I created one model and inside that I am storing user id with comma separated value like “7154,8059,8065”

Users            String

Now I want to add or remove some user id from that model using prisma ORM only not with rawQuery

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jeminkcommented, May 26, 2021

@ryands17 Currently I am using this below query and let’s assume assignedUsers has 10 ids

await this.ctx?.prisma?.$queryRaw(
        'UPDATE staff SET Location = CONCAT(Location, ?) where id IN (?)',
        `,${locationId}`,
        assignedUsers.join(', ')
      )

So if I want to use prisma model then I have to make 11 db calls. 1st to get the Location field values based on assignedUser then next 10 call to update it. Because we can’t use updateMany because in my case Location value is different

1reaction
ryands17commented, May 26, 2021

Unless you have the value at hand, no you cannot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to concatenate API request URL safely - Stack Overflow
For the simple abstract approach, you can use Kotlin's joinToString() : val query_part = arrayOf( "fields[...]", "include..." ).
Read more >
concat (Jason API)
Internal action: .concat . Description: concatenates strings or lists. Parameters: ... Parameters that are not string are concatenated using the toString method ...
Read more >
Write a Dynamic fetch() Call with .concat() | by Erick Castille
According to MDN web docs, “The concat() method is used to merge two or more arrays. This method does not change the existing...
Read more >
String.prototype.concat() - JavaScript - MDN Web Docs
The concat() method concatenates the string arguments to the calling string and returns a new string.
Read more >
concat() Method of Stream Interface in Java API
This interface is created on any stream of objects and it provides a lot of methods that can be used to modify the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found