orientdb.insert()
.into('User')
.set({name: 'John', surname: 'Smith'})
.all()
.then(function(result) {
...
}, function(error){
...
})
This is the way to insert a single vertex in OrientDb via orientjs. How to insert multiple objects at once?
The following query
orientdb.insert()
.into('User')
.set([{name: 'John', surname: 'Smith'}, {name: 'Harry', surname: 'Potter'}])
.all()
.then(function(result) {
...
}, function(error){
...
})
inserts only the last element ({name: 'Harry', surname: 'Potter'}
)