Orientdb: [enhancement] insert multiple schemaless records using JSON

Created on 14 Aug 2015  Â·  3Comments  Â·  Source: orientechnologies/orientdb

This is originally from https://groups.google.com/forum/#!topic/orient-database/A2eJvthrYnk. It was suggested I open an enhancement ticket.

I have three records that I need to insert in a single query:

{name: 'mal', role: 'captain', ship: 'firefly'}
{name: 'zoe', role: 'first', husband: 'wash'}
{name: 'book', role: 'shephard', past: 'unknown'}

What I really want is for this to be possible:

INSERT INTO characters CONTENT {}, {}, {}

Obviously with the correct JSON content. But that throws errors.

The only alternative I can find is following the VALUES syntax like

INSERT INTO characters (name, role, ship, husband, past) 
VALUES
('mal', 'captain', 'firefly', null, null),
('zoe', 'first', null, 'wash', null),
('book', 'shephard', null, null, 'unknown')

However, building this programatically (like inside a query builder) is a nightmare.

enhancement

Most helpful comment

What I really want is for this to be possible:
INSERT INTO characters CONTENT {}, {}, {}

or:
INSERT INTO characters CONTENT [{}, {}, {}]

All 3 comments

What I really want is for this to be possible:
INSERT INTO characters CONTENT {}, {}, {}

or:
INSERT INTO characters CONTENT [{}, {}, {}]

:+1:

This is cool, nice catch @chrismichaels84. Kudos to your team @luigidellaquila and @lvca when you manage this enhancement in version 2.2.0-beta
:+1:

Was this page helpful?
0 / 5 - 0 ratings