arangodb / arangodb-php

PHP ODM for ArangoDB
https://www.arangodb.com
Apache License 2.0
183 stars 43 forks source link

_key constraints #174

Closed m0ppers closed 9 years ago

m0ppers commented 9 years ago

Inserting documents having -1 as _key is perfectly legal. The checks in Document.php (at least there) are wrong.

I don't know however what is legal. Otherwise i would have submitted a PR ;)

jsteemann commented 9 years ago

Document keys in ArangoDB should be strings. -1 (as a number) is not working on the server level, but "-1" (as a string) is legal.

But the regex /^\w+$/ in Document.php definitely is too restrictive.

jsteemann commented 9 years ago

fixed in devel, 2.2 and master.