Create new bucket with 10 records from an old bucket

I am trying to create a new bucket and populate it with the first 10 records of an existing bucket. Here is the query I used:

INSERT INTO kate (KEY UUID())
Select * from stuff limit 10;
The results I got were not what I intended:
{
“stuff”: {
“Computer”: “1266F66B524F1.gmail.com”,
“Role”: “Cashregister”,
“TimeGenerated”: “2020-08-21T09:00:00Z”
}
}
How do I just get the data values and not the “stuff” array?

INSERT INTO `kate` (KEY UUID(), VALUE  doc)
Select doc from `stuff` AS  doc limit 10;

Okay thanks. :blush:

Now if I wanted to use a composite key instead of UUID, what is the syntax of that?

INSERT INTO `kate` (KEY k, VALUE  doc)
Select  doc.Role ||  ":"|| doc.Computer AS k, doc from `stuff` AS  doc limit 10;

https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/insert.html

I’m doing something wrong, it gives me an error on the colon.
“code”: 3000,
“msg”: “syntax error - at Role”,
“query”: “insert into kate-nouuid (key k, value doc)\n select doc.Role || ":" || doc.Computer AS k, doc from stuff as doc limit 10;”

BTW I already read the documents on insert but the examples are too simple and the syntax doesn’t tell you how to handle multiple key values or even multiple values to load. It only shows all or nothing.

This didn’t work, it created 10 records with UUIDs and no data. I have a lot to learn here clearly.
INSERT INTO kate (KEY UUID(), value doc)
Select doc from stuff limit 10;

You removed Alias of the bucket.

Or you can use the following

INSERT INTO kate (KEY UUID(), value stuff)
Select stuff from stuff limit 10;

Doh!

Yes this works:
insert into kate-uuid (key UUID(), value doc)
select doc from rca doc limit 10;