Hi all,
I’m trying to insert a document with a select statement. My problem is the select result is an array instead of an object. For example:
Insert into (Key,value) values (“1”, select …) and the resulted insert is an array of the select results even if the result is a single document: [{document 1}]. I want to just insert the document, not an array of documents, something like this {document1}
INSERT INTO `travel-sample` (KEY UUID(), VALUE _country)
SELECT _country FROM `travel-sample` _country
WHERE type = "airport" AND airportname = "Heathrow"
Thanks a lot. Anyway, I tried this solution before, but it’s not possible. My query returns different values for some joins and let commands. It is not possible to do this with more than one value (_country1, _country2, etc. in your example)
Solved. The solution was something like this:
insert into … (key … ,value _country)
select _country from (select a,b, c …
let
a=…
b=…) _country.
Thanks a lot for your help.