You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-3Lines changed: 32 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -35,14 +35,38 @@ conn.connect()
35
35
});
36
36
```
37
37
38
+
39
+
##Msgpack implentation
40
+
41
+
You can yse any implementation that can be duck typing with next interface:
42
+
43
+
```
44
+
45
+
//msgpack implementation example
46
+
/*
47
+
@interface
48
+
decode: (Buffer buf)
49
+
encode: (Object obj)
50
+
*/
51
+
var exampleCustomMsgpack = {
52
+
encode: function(obj){
53
+
return yourmsgpack.encode(obj);
54
+
},
55
+
decode: function(buf){
56
+
return yourmsgpack.decode(obj);
57
+
}
58
+
};
59
+
```
60
+
38
61
##API
39
62
40
63
**class TarantoolConnection(options)**
41
64
```
42
65
var defaultOptions = {
43
66
host: 'localhost',
44
67
port: '3301',
45
-
log: false
68
+
log: false,
69
+
msgpack: require('msgpack-lite')
46
70
};
47
71
```
48
72
You can overrid default options with options.
@@ -89,12 +113,11 @@ Promise resolve a new tuple.
89
113
90
114
**upsert(spaceId: Number or String, key: tuple, ops: array of operations, tuple: tuple) : Promise()**
91
115
92
-
About operation: https://github.com/tarantool/tarantool/issues/905
116
+
About operation: http://tarantool.org/doc/book/box/box_space.html#lua-function.space_object.upsert
93
117
94
118
Ops: http://tarantool.org/doc/book/box/box_space.html (search for update here).
95
119
96
120
Promise resolve nothing.
97
-
Knowing issues if it cannot be updated by your ops it wouldn't return error just only at tarantool side but not at protocol. See https://github.com/tarantool/tarantool/issues/966
98
121
99
122
**replace(spaceId: Number or String, tuple: tuple) : Promise(Tuple)**
100
123
@@ -149,6 +172,12 @@ It's ok you can do whatever you need. I add log options for some technical infor
149
172
150
173
##Changelog
151
174
175
+
###0.4.0
176
+
177
+
Change msgpack5 to msgpack-lite(thx to @arusakov).
0 commit comments