mirror of https://gitee.com/bigwinds/arangodb
17 lines
531 B
Plaintext
17 lines
531 B
Plaintext
arangosh> db._create("users", { keyOptions: { allowUserKeys: false } });
|
|
[ArangoCollection 593515932, "users" (type document, status loaded)]
|
|
arangosh> db.users.save({ name: "user 1" });
|
|
{
|
|
"_id" : "users/593843612",
|
|
"_rev" : "593843612",
|
|
"_key" : "593843612"
|
|
}
|
|
arangosh> db.users.save({ name: "user 2", _key: "myuser" });
|
|
[ArangoError 1222: collection does not allow using user-defined keys]
|
|
arangosh> db.users.save({ name: "user 3" });
|
|
{
|
|
"_id" : "users/594171292",
|
|
"_rev" : "594171292",
|
|
"_key" : "594171292"
|
|
}
|