mirror of https://gitee.com/bigwinds/arangodb
fixed db.collection.document(collection / key)
This commit is contained in:
parent
975ef80e99
commit
35a58d4a69
|
@ -217,7 +217,7 @@ static int RevisionKey (TRI_key_generator_t* const generator,
|
||||||
current += TRI_StringUInt64InPlace(revision, current);
|
current += TRI_StringUInt64InPlace(revision, current);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char numBuffer[22];
|
char numBuffer[22]; // a uint64 cannot be longer than this
|
||||||
size_t length;
|
size_t length;
|
||||||
|
|
||||||
length = TRI_StringUInt64InPlace(revision, (char*) &numBuffer);
|
length = TRI_StringUInt64InPlace(revision, (char*) &numBuffer);
|
||||||
|
|
|
@ -1109,6 +1109,11 @@ function ArangoCollection (database, data) {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ArangoCollection.prototype._documenturl = function (id) {
|
ArangoCollection.prototype._documenturl = function (id) {
|
||||||
|
var s = id.split("/");
|
||||||
|
|
||||||
|
if (s.length == 1) {
|
||||||
|
return this._database._documenturl(this.name() + "/" + id, this.name());
|
||||||
|
}
|
||||||
return this._database._documenturl(id, this.name());
|
return this._database._documenturl(id, this.name());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1729,7 +1734,7 @@ function ArangoCollection (database, data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rev === null) {
|
if (rev === null) {
|
||||||
requestResult = this._database._connection.GET(this._documenturl(this._name + "/" + id));
|
requestResult = this._database._connection.GET(this._documenturl(id));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
requestResult = this._database._connection.GET(this._documenturl(id),
|
requestResult = this._database._connection.GET(this._documenturl(id),
|
||||||
|
|
Loading…
Reference in New Issue