| 1 |
## generated |
| 2 |
## Doc: Delete multiple documents by id |
| 3 |
|
| 4 |
--source include/xplugin_preamble.inc |
| 5 |
--source include/xplugin_create_user.inc |
| 6 |
|
| 7 |
create schema xtest; |
| 8 |
|
| 9 |
## Test starts here |
| 10 |
--write_file $MYSQL_TMP_DIR/delete_del_multi_by_id.xpl |
| 11 |
## Test data |
| 12 |
|
| 13 |
-->stmtadmin create_collection {"schema":"xtest","name":"mycoll"} |
| 14 |
-->recvresult |
| 15 |
|
| 16 |
-->sql |
| 17 |
use xtest; |
| 18 |
insert into mycoll (doc) values ('{"_id": "1", "name": "Joe1"}'); |
| 19 |
insert into mycoll (doc) values ('{"_id": "2", "name": "Joe2", "last_name": "Smith"}'); |
| 20 |
insert into mycoll (doc) values ('{"_id": "3", "name": "Joe2", "last_name": "Shmo"}'); |
| 21 |
select doc from mycoll; |
| 22 |
-->endsql |
| 23 |
|
| 24 |
Mysqlx.Crud.Delete { |
| 25 |
collection { |
| 26 |
name: "mycoll" |
| 27 |
schema: "xtest" |
| 28 |
} |
| 29 |
data_model: DOCUMENT |
| 30 |
criteria { |
| 31 |
type: OPERATOR |
| 32 |
operator { |
| 33 |
name: "in" |
| 34 |
param { |
| 35 |
type: IDENT identifier { name: "_id" } |
| 36 |
} |
| 37 |
param { |
| 38 |
type: LITERAL |
| 39 |
literal { |
| 40 |
type: V_OCTETS |
| 41 |
v_octets {value:"1"} |
| 42 |
} |
| 43 |
} |
| 44 |
param { |
| 45 |
type: LITERAL |
| 46 |
literal { |
| 47 |
type: V_OCTETS |
| 48 |
v_octets {value:"3"} |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
## expect Mysqlx.Sql.StmtExecuteOk |
| 56 |
-->recvresult |
| 57 |
|
| 58 |
-->sql |
| 59 |
select doc from xtest.mycoll; |
| 60 |
-->endsql |
| 61 |
EOF |
| 62 |
|
| 63 |
--exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/delete_del_multi_by_id.xpl 2>&1 |
| 64 |
|
| 65 |
## Cleanup |
| 66 |
--source ../include/xplugin_cleanup.inc |