All Questions
Tagged with insert-update arrays
25
questions
1
vote
1
answer
230
views
golang/pq : "pq: function uniq(integer[]) does not exist"
Here's my code (works fine with gin)
query :=`
UPDATE posts SET liked_by = uniq(array_append(liked_by, $1))
WHERE id = $2
RETURNING liked_by`
return p.DB.Exec(query, userID, post.ID)
The error I'm ...
1
vote
1
answer
434
views
Swap elements in a MongoDB array given only their ids (in-place)
I read some threads about it, such as this one and that one, but they both come with major flaws & caveats (to me at least).
What I want is simple! An update query that:
swaps 2 elements in an ...
0
votes
1
answer
50
views
MongoDB, update an existing collection via aggregate
I have following mongodb collection
{
"_id" : "B0006ZPB0S",
"title" : "Pretty Diamond-cut Black Hills Gold & Sterling Silver Rose Bud Women's Ring&...
1
vote
0
answers
22
views
Inserting a sub-menu that updates records within a main menu
I am trying to make an Insert or Update menu option in my Main Menu, that can update the Quiz Scores (qz1,qz2,qz3) of any student on the array. However, I am getting stuck at displaying after ...
0
votes
2
answers
324
views
adding array data from a file to an existing array using jq
I am generating a JSON file (input.json) that looks like this:
[
{
"name": "MINIMUM_NOTICE_PERIOD",
"value": "3"
},
{
"name": "...
0
votes
1
answer
2k
views
Update Query: Snowflake table variant column
I am still learning Snowflake, any help would be really appreciated
I have a table(tbl1) that has a variant column(column_json) which looks like below:
{
"catalog": [
{
"...
0
votes
1
answer
957
views
Problems with "updateMany" and "$pull" on array properties
I have the following object in my mongodb:
{
"item": {
"id": "/Ed/6wigZ9LTLs2mPDWDzOFD/he0vbUEvQBl2Bga/T8=",
"status": {
"likes": [
...
0
votes
1
answer
186
views
laravel array update multiple rows with diffrent ids
i am stuck in when i update multiple array value then each time update same value in diffrent ids like i have three fields like email,alert_level and select in select dropdoewn depends on alert_level ...
2
votes
3
answers
3k
views
How can I accessed upsertedId when using updateOne in MongoDB
I have new data that I want to insert in my array of blog (My collection look like this - shown below):-
{
_id: 0,
// other vars here...,
blog: [
{
_id: 0,
...
0
votes
1
answer
25
views
How to update the details in an array on post in MongoDB?
Although its printing the 'success' in console but i am unable to see the changes after clicking on post update.
User.update( { email:req.user.email },
{ $set: {
"Addtasks.$[].topic":...
0
votes
1
answer
1k
views
Update or Insert new data in nested array MongoDB
I'm using Node JS with Mongoose fyi. Given I've something like this:-
let people = [
{
"_id": 1,
"name": "Person 1",
"pets": [
{
"_id": 1,
...
0
votes
0
answers
70
views
PHP new strings update in DB with unshift?
I have a problem to adding more strings in my database.
The idea is: SELECT information, then added array together, after these UPDATE to database.
These are in one code, but UPDATE not working with ...
0
votes
1
answer
33
views
Inserting a new object into nested array
I have a document in mongodb as follows:
{
"_id" : 1,
"name" : "Christine Franklin",
"degrees" : [
{
"level" : "Master",
info:[ {"major" : "Biology",
"...
0
votes
1
answer
2k
views
javascript array of objects update by uuid
Hi maybe I'm block headed or just tired:
But i can't find an easy solution to update / manipulate an object array.
(without several loops)
I'm getting (via a Listener callback every second) status ...
0
votes
1
answer
42
views
mysqli_query insert and update within array not working
Hey everyone I am trying to run two insert statements and than finally run an update statement within a php array but it seems not to be working correctly. I realize this code has some problems for ...