orientdb.insert()
.into('User')
.set({name: 'John', surname: 'Smith'})
.all()
.then(function(result) {
...
}, function(error){
...
})
这是通过 orientjs 在 OrientDb 中插入单个顶点的方法。如何一次插入多个对象?
以下查询
orientdb.insert()
.into('User')
.set([{name: 'John', surname: 'Smith'}, {name: 'Harry', surname: 'Potter'}])
.all()
.then(function(result) {
...
}, function(error){
...
})
仅插入最后一个元素 ( {name: 'Harry', surname: 'Potter'}
)