We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9308d46 commit fb82683Copy full SHA for fb82683
lib/connection.js
@@ -456,7 +456,7 @@ TarantoolConnection.prototype.update = function(spaceId, indexId, key, ops){
456
457
TarantoolConnection.prototype.upsert = function(spaceId, ops, tuple){
458
return new Promise(function (resolve, reject) {
459
- if (Array.isArray(ops) && Array.isArray(key)){
+ if (Array.isArray(ops)){
460
if (typeof(spaceId)=='string')
461
{
462
return this._getMetadata(spaceId, 0)
@@ -482,7 +482,7 @@ TarantoolConnection.prototype.upsert = function(spaceId, ops, tuple){
482
this.commandsQueue.push([tarantoolConstants.RequestCode.rqUpsert, reqId, {resolve: resolve, reject: reject}]);
483
}
484
else
485
- reject(new Error('need array'));
+ reject(new Error('need ops array'));
486
}.bind(this));
487
};
488
test/app.js
@@ -272,7 +272,7 @@ describe('Tarantool Connection tests', function(){
272
273
});
274
it('insert', function(done){
275
- conn.upsert('upstest', 1, [['+', 3, 3]], [1, 2, 3])
+ conn.upsert('upstest', [['+', 3, 3]], [1, 2, 3])
276
.then(function() {
277
return conn.select('upstest', 'primary', 1, 0, 'eq', 1);
278
})
@@ -287,9 +287,9 @@ describe('Tarantool Connection tests', function(){
287
288
289
it('update', function(done){
290
- conn.upsert('upstest', 2, [['+', 2, 2]], [2, 4, 3])
+ conn.upsert('upstest', [['+', 2, 2]], [2, 4, 3])
291
.then(function(){
292
- return conn.upsert('upstest', 2, [['+', 2, 2]], [2, 4, 3]);
+ return conn.upsert('upstest', [['+', 2, 2]], [2, 4, 3]);
293
294
295
return conn.select('upstest', 'primary', 1, 0, 'eq', 2) ;
test/box.lua
@@ -83,3 +83,25 @@ function clearaddmore()
83
end
84
85
86
+
87
+if not box.schema.func.exists('clearaddmore') then
88
+ box.schema.func.create('clearaddmore')
89
+ box.schema.user.grant('test', 'execute', 'function', 'clearaddmore')
90
+end
91
+if not box.schema.func.exists('myget') then
92
+ box.schema.func.create('myget')
93
+ box.schema.user.grant('test', 'execute', 'function', 'myget')
94
95
+if not box.schema.func.exists('batch') then
96
+ box.schema.func.create('batch')
97
+ box.schema.user.grant('test', 'execute', 'function', 'batch')
98
99
+if not box.schema.func.exists('myprint') then
100
+ box.schema.func.create('myprint')
101
+ box.schema.user.grant('test', 'execute', 'function', 'myprint')
102
103
+if not box.schema.func.exists('test_delete') then
104
+ box.schema.func.create('test_delete')
105
+ box.schema.user.grant('test', 'execute', 'function', 'test_delete')
106
107
0 commit comments