mirror of https://gitee.com/bigwinds/arangodb
added derived file
This commit is contained in:
parent
9a56f68468
commit
a3cb0423c2
|
@ -315,8 +315,17 @@ ArangoCollection.prototype.type = function () {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ArangoCollection.prototype.properties = function (properties) {
|
ArangoCollection.prototype.properties = function (properties) {
|
||||||
var requestResult;
|
var attributes = {
|
||||||
|
"doCompact": true,
|
||||||
|
"journalSize": true,
|
||||||
|
"waitForSync": true,
|
||||||
|
"shardKeys": false,
|
||||||
|
"numberOfShards": false,
|
||||||
|
"keyOptions": false
|
||||||
|
};
|
||||||
|
var a;
|
||||||
|
|
||||||
|
var requestResult;
|
||||||
if (properties === undefined) {
|
if (properties === undefined) {
|
||||||
requestResult = this._database._connection.GET(this._baseurl("properties"));
|
requestResult = this._database._connection.GET(this._baseurl("properties"));
|
||||||
|
|
||||||
|
@ -325,14 +334,12 @@ ArangoCollection.prototype.properties = function (properties) {
|
||||||
else {
|
else {
|
||||||
var body = {};
|
var body = {};
|
||||||
|
|
||||||
if (properties.hasOwnProperty("doCompact")) {
|
for (a in attributes) {
|
||||||
body.doCompact = properties.doCompact;
|
if (attributes.hasOwnProperty(a)) {
|
||||||
}
|
if (properties.hasOwnProperty(a) && properties[a]) {
|
||||||
if (properties.hasOwnProperty("journalSize")) {
|
body[a] = properties[a];
|
||||||
body.journalSize = properties.journalSize;
|
}
|
||||||
}
|
}
|
||||||
if (properties.hasOwnProperty("waitForSync")) {
|
|
||||||
body.waitForSync = properties.waitForSync;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
requestResult = this._database._connection.PUT(this._baseurl("properties"),
|
requestResult = this._database._connection.PUT(this._baseurl("properties"),
|
||||||
|
@ -341,12 +348,12 @@ ArangoCollection.prototype.properties = function (properties) {
|
||||||
arangosh.checkRequestResult(requestResult);
|
arangosh.checkRequestResult(requestResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = {
|
var result = { };
|
||||||
waitForSync : requestResult.waitForSync,
|
for (a in attributes) {
|
||||||
journalSize : requestResult.journalSize,
|
if (attributes.hasOwnProperty(a) && requestResult.hasOwnProperty(a)) {
|
||||||
isVolatile : requestResult.isVolatile,
|
result[a] = requestResult[a];
|
||||||
doCompact : requestResult.doCompact
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
if (requestResult.keyOptions !== undefined) {
|
if (requestResult.keyOptions !== undefined) {
|
||||||
result.keyOptions = requestResult.keyOptions;
|
result.keyOptions = requestResult.keyOptions;
|
||||||
|
|
Loading…
Reference in New Issue