Created
February 2, 2017 13:30
-
-
Save begetan/55fce28f5db789562f24ad08cac2832f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$tarantool = new Tarantool('localhost'); | |
$tarantool->upsert("server",array(1,0,0,0), | |
array ( | |
array( | |
"field" => 2, | |
"op" => "+", | |
"arg" => 1 | |
), | |
array( | |
"field" => 3, | |
"op" => "-", | |
"arg" => 1 | |
) | |
) | |
); | |
# Expect [1, 0, 0, 0] got [1, 0, 0, 0] | |
$tarantool->update("server",1, | |
array ( | |
array( | |
"field" => 2, | |
"op" => "+", | |
"arg" => 1 | |
), | |
array( | |
"field" => 3, | |
"op" => "-", | |
"arg" => 1 | |
) | |
) | |
); | |
# Expect [1, 0, 1, -1] got [1, 0, 1, -1] | |
$tarantool->upsert("server",array(1,0,0,0), | |
array ( | |
array( | |
"field" => 2, | |
"op" => "+", | |
"arg" => 1 | |
), | |
array( | |
"field" => 3, | |
"op" => "-", | |
"arg" => 1 | |
) | |
) | |
); | |
# Expect [1, 0, 2, -2] got [1, 1, 0, -1] | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment