mirror of https://gitee.com/bigwinds/arangodb
17 lines
538 B
Plaintext
17 lines
538 B
Plaintext
arangosh> db._create("users", { keyOptions: { allowUserKeys: false } });
|
|
[ArangoCollection 1121383307, "users" (type document, status loaded)]
|
|
arangosh> db.users.save({ name: "user 1" });
|
|
{
|
|
"_id" : "users/1121710987",
|
|
"_rev" : "1121710987",
|
|
"_key" : "1121710987"
|
|
}
|
|
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/1122038667",
|
|
"_rev" : "1122038667",
|
|
"_key" : "1122038667"
|
|
}
|