Hello, i have json look like this
“host1”: {
“instances”: [
{
“capacity”: {
“change”: {
“rps”: 0,
“rt”: 1000
},
“max_connections”: 0,
“read”: {
“rps”: 0,
“rt”: 500
}
},
“conn_string”: “local”,
“state”: “enabled”
}
],
“quotas”: {
“activities”: {
“redirect”: {
“change”: 100,
“read”: 100
},
“lost”: {
“change”: 0,
“read”: 1
}
},
“users”: {
“default”: {
“change”: 0,
“max_connections”: 0,
“read”: 0
},
“admin”: {
“change”: 0,
“max_connections”: 1,
“read”: 1
}
}
}
},
“host2”: {
“instances”: [
{
“capacity”: {
“change”: {
“rps”: 0,
“rt”: 1000
},
“max_connections”: 0,
“read”: {
“rps”: 0,
“rt”: 500
}
},
“conn_string”: “local”,
“state”: “enabled”
}
],
“quotas”: {
“activities”: {
“redirect”: {
“change”: 100,
“read”: 100
},
“lost”: {
“change”: 0,
“read”: 1
}
},
“users”: {
“default”: {
“change”: 0,
“max_connections”: 0,
“read”: 0
},
“admin”: {
“change”: 0,
“max_connections”: 1,
“read”: 1
}
}
}
},
I want update filed conn_string : enabled in status conn_string: disabled. How to do it?
I have already helped How to make select: URL How to Select' field's in list N1QL
I tryed this query
UPDATE registry USE KEYS ‘source_ucp’ SET state = enabled WHERE state IN (SELECT op.name,opi.state FROM registry AS r USE KEYS “source_ucp” UNNEST OBJECT_PAIRS® AS op UNNEST op.val.instances AS opi WHERE op.name IN [“host1”,“host2”]);
Query dont work