1

I want to insert documents that are mapped to a _class : org.some.package.class2 from all documents that already exist (in the same bucket) and are mapped to another _class org.some.package.class2. I want preserve the same structure of the existing documents. Example: I want to create this document

{
  "name": "Doe",
  "firstName": "Joe"
  "phone": "[
      "0123456789", "0987654321"
    ]",
  "email": "test@test.com",
  "_class": "org.some.package.class1"
}

from

{
  "name": "Doe",
  "firstName": "Joe"
  "phone": "[
      "0123456789", "0987654321"
    ]",
  "email": "test@test.com",
  "_class": "org.some.package.class2"
}
Elmehdi93
  • 70
  • 1
  • 9
  • 1
    This seems like a simple `UPDATE`, is there any reason why that wouldn't work? – Matthew Groves Jun 10 '21 at 15:40
  • 1
    As Mathew Groves mentioned use Update. If you need to duplicate the documents and change _class use INSERT INTO ..... SELECT ... – vsr Jun 10 '21 at 15:47

0 Answers0