diff --git a/js/apps/system/aardvark/frontend/js/modules/org/arangodb/arango-collection.js b/js/apps/system/aardvark/frontend/js/modules/org/arangodb/arango-collection.js index 0242e25562..9e3c027be8 100644 --- a/js/apps/system/aardvark/frontend/js/modules/org/arangodb/arango-collection.js +++ b/js/apps/system/aardvark/frontend/js/modules/org/arangodb/arango-collection.js @@ -315,8 +315,17 @@ ArangoCollection.prototype.type = function () { //////////////////////////////////////////////////////////////////////////////// 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) { requestResult = this._database._connection.GET(this._baseurl("properties")); @@ -325,14 +334,12 @@ ArangoCollection.prototype.properties = function (properties) { else { var body = {}; - if (properties.hasOwnProperty("doCompact")) { - body.doCompact = properties.doCompact; - } - if (properties.hasOwnProperty("journalSize")) { - body.journalSize = properties.journalSize; - } - if (properties.hasOwnProperty("waitForSync")) { - body.waitForSync = properties.waitForSync; + for (a in attributes) { + if (attributes.hasOwnProperty(a)) { + if (properties.hasOwnProperty(a) && properties[a]) { + body[a] = properties[a]; + } + } } requestResult = this._database._connection.PUT(this._baseurl("properties"), @@ -341,12 +348,12 @@ ArangoCollection.prototype.properties = function (properties) { arangosh.checkRequestResult(requestResult); } - var result = { - waitForSync : requestResult.waitForSync, - journalSize : requestResult.journalSize, - isVolatile : requestResult.isVolatile, - doCompact : requestResult.doCompact - }; + var result = { }; + for (a in attributes) { + if (attributes.hasOwnProperty(a) && requestResult.hasOwnProperty(a)) { + result[a] = requestResult[a]; + } + } if (requestResult.keyOptions !== undefined) { result.keyOptions = requestResult.keyOptions;