From eb2bfee77bd1e54401f7010f7a7d8469c347eeb9 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Mon, 22 Dec 2014 15:04:41 +0100 Subject: [PATCH 1/4] updated Upgrading notes --- CHANGELOG | 2 +- DEPRECATED.md | 30 +-- .../Books/Users/Installing/Upgrading.mdpp | 5 +- .../Users/NewFeatures/NewFeatures24.mdpp | 12 +- Documentation/Books/Users/SUMMARY.md | 4 +- .../Books/Users/Upgrading/Upgrading24.mdpp | 113 +++++++++++ .../Users/Upgrading/UpgradingChanges24.mdpp | 187 ++++++++++++++++++ 7 files changed, 329 insertions(+), 24 deletions(-) create mode 100644 Documentation/Books/Users/Upgrading/Upgrading24.mdpp create mode 100644 Documentation/Books/Users/Upgrading/UpgradingChanges24.mdpp diff --git a/CHANGELOG b/CHANGELOG index eb69748608..81059c33bb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -116,7 +116,7 @@ v2.4.0 (XXXX-XX-XX) * fixed issue #1134: Change the default endpoint to localhost - This change will modify the ip address ArangoDB listens on to 127.0.0.1 by default. + This change will modify the IP address ArangoDB listens on to 127.0.0.1 by default. This will make new ArangoDB installations unaccessible from clients other than localhost unless changed. This is a security feature. diff --git a/DEPRECATED.md b/DEPRECATED.md index 87b6d85bd7..a79fa49f2d 100644 --- a/DEPRECATED.md +++ b/DEPRECATED.md @@ -29,27 +29,27 @@ migrations will also be detailed here. * Foxx: `controller.collection` is now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `appContext.collection` instead. * Foxx: `Model.extend({}, {attributes: {}})` is now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `Model.extend({schema: {}})` instead. * Foxx: `requestContext.bodyParam(paramName, description, Model)` is now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `requestContext.bodyParam(paramName, options)` instead. -* Foxx: `requestContext.queryParam({type: string})` is now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `requestContext.queryParam({type: joi})` instead. -* Foxx: `requestContext.pathParam({type: string})` is now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `requestContext.pathParam({type: joi})` instead. -* Graph: The modules `org/arangodb/graph` and `org/arangodb/graph-blueprint` are now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use module `org/arangodb/general-graph` instead. -* Http: The api `_api/graph` is now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use the general graph api `_api/gharial` instead. +* Foxx: `requestContext.queryParam({type: string})` is now deprecated. Please use `requestContext.queryParam({type: joi})` instead. +* Foxx: `requestContext.pathParam({type: string})` is now deprecated. Please use `requestContext.pathParam({type: joi})` instead. +* Graph: The modules `org/arangodb/graph` and `org/arangodb/graph-blueprint` are now deprecated. Please use module `org/arangodb/general-graph` instead. +* Http: The api `_api/graph` is now deprecated. Please use the general graph api `_api/gharial` instead. * Replication: the methods `logger.start`, `logger.stop` and `logger.properties` are now deprecated. Using them will raise a warning. * Replication: the HTTP methods `PUT /_api/replication/logger-start`, `PUT /_api/replication/logger-stop`, `GET /_api/replication/logger-config` and `PUT /_api/replication/logger-config` are now deprecated. Using them will raise a warning. * General-Graph: In the module `org/arangodb/general-graph` the functions `_undirectedRelation` and `_directedRelation` is no longer suggested, they will be deprecated int the next version. Both functions have been unified to `_relation`. ## 2.4 -* Foxx: `controller.collection` is no longer available by default. If you still want to use it, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `appContext.collection` instead. -* Foxx: `Model.extend({}, {attributes: {}})` is no longer available by default. If you still want to use it, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `Model.extend({schema: {}})` instead. -* Foxx: `requestContext.bodyParam(paramName, description, Model)` is no longer available by default. If you still want to use it, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `requestContext.bodyParam(paramName, options)` instead. -* Foxx: `requestContext.queryParam({type: string})` is no longer available by default. If you still want to use it, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `requestContext.queryParam({type: joi})` instead. -* Foxx: `requestContext.pathParam({type: string})` is no longer available by default. If you still want to use it, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `requestContext.pathParam({type: joi})` instead. -* Graph: The modules `org/arangodb/graph` and `org/arangodb/graph-blueprint` are no longer available by default. If you still want to use them, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use module `org/arangodb/general-graph` instead. -* Http: The api `_api/graph` is no longer available by default. If you still want to use it, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use the general graph api `_api/gharial` instead. +* Foxx: method `controller.collection()` is deprecated, it will raise a warning if you use it. Please use `appContext.collection` instead. +* Foxx: property `FoxxRepository.modelPrototype` is deprecated, it will raise a warning if you use it. Please use `FoxxRepository.model` instead. +* Foxx: `requestContext.bodyParam(paramName, description, Model)` is deprecated. Please use `requestContext.bodyParam(paramName, options)` instead. +* Foxx: `requestContext.queryParam({type: string})` is deprecated. Please use `requestContext.queryParam({type: joi})` instead. +* Foxx: `requestContext.pathParam({type: string})` is deprecated Please use `requestContext.pathParam({type: joi})` instead. +* Foxx: `Model.extend({}, {attributes: {}})` is deprecated. Please use `Model.extend({schema: {}})` instead. +* General-Graph: In the module `org/arangodb/general-graph` the functions `_undirectedRelation` and `_directedRelation` are deprecated. Both functions have been unified to `_relation`. +* Graph: The modules `org/arangodb/graph` and `org/arangodb/graph-blueprint` are deprecated. Please use module `org/arangodb/general-graph` instead. +* The HTTP REST API `_api/graph` and all its methods are deprecated. Please use the general graph API `_api/gharial` instead. * Replication: the methods `logger.start`, `logger.stop` and `logger.properties` are no longer available. -* Replication: the HTTP methods `PUT /_api/replication/logger-start`, `PUT /_api/replication/logger-stop`, `GET /_api/replication/logger-config` and `PUT /_api/replication/logger-config` are no longer available. -To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. -* General-Graph: In the module `org/arangodb/general-graph` the functions `_undirectedRelation` and `_directedRelation` are deprecated and will throw an error if you use them. Both functions have been unified to `_relation`. +* Replication: the HTTP REST API methods `PUT /_api/replication/logger-start`, `PUT /_api/replication/logger-stop`, `GET /_api/replication/logger-config` and `PUT /_api/replication/logger-config` are no longer available. ## 2.5 @@ -60,4 +60,4 @@ To suppress the warning, please start `arangod` with the option `--server.defaul * Foxx: `requestContext.pathParam({type: string})` has been removed entirely. Please use `requestContext.pathParam({type: joi})` instead. * Graph: The modules `org/arangodb/graph` and `org/arangodb/graph-blueprint` have been removed entirely. Please use module `org/arangodb/general-graph` instead. * Http: The api `_api/graph` has been removed entirely. Please use the general graph api `_api/gharial` instead. -* General-Graph: In the module `org/arangodb/general-graph` the functions `_undirectedRelation` and `_directedRelation` are no longer available by default, if you still want to use them start `arangod` with the option `--server.default-api-compatibility 20300`. Both functions have been unified to `_relation`. +* General-Graph: In the module `org/arangodb/general-graph` the functions `_undirectedRelation` and `_directedRelation` are no longer available. Both functions have been unified to `_relation`. diff --git a/Documentation/Books/Users/Installing/Upgrading.mdpp b/Documentation/Books/Users/Installing/Upgrading.mdpp index ff693038c8..8647b5c130 100644 --- a/Documentation/Books/Users/Installing/Upgrading.mdpp +++ b/Documentation/Books/Users/Installing/Upgrading.mdpp @@ -2,9 +2,10 @@ !SUBSECTION Recommended upgrade procedure -To upgrade an existing ArangoDB database to a newer version of ArangoDB (e.g. 1.2 to 1.3, or 2.0 to 2.1), the following method is recommended: +To upgrade an existing ArangoDB database to a newer version of ArangoDB +(e.g. 2.2 to 2.3, or 2.3 to 2.4), the following method is recommended: -* Check the *CHANGELOG* and the [list of incompatible changes](../Upgrading/UpgradingChanges23.html) for API or other changes in the new version of ArangoDB and make sure your applications can deal with them +* Check the *CHANGELOG* and the [list of incompatible changes](../Upgrading/UpgradingChanges24.html) for API or other changes in the new version of ArangoDB and make sure your applications can deal with them * Stop the "old" arangod service or binary * Copy the entire "old" data directory to a safe place (that is, a backup) * Install the new version of ArangoDB and start the server with the *--upgrade* option once. This might write to the logfile of ArangoDB, so you may want to check the logs for any issues before going on. diff --git a/Documentation/Books/Users/NewFeatures/NewFeatures24.mdpp b/Documentation/Books/Users/NewFeatures/NewFeatures24.mdpp index 8ee91a680e..389ef00185 100644 --- a/Documentation/Books/Users/NewFeatures/NewFeatures24.mdpp +++ b/Documentation/Books/Users/NewFeatures/NewFeatures24.mdpp @@ -235,9 +235,11 @@ If this is also undesired, it is also possible to specify a list of collections exclude from the initial synchronisation and the continuous replication using the `restrictCollections` attribute, e.g.: - replication.applier.properties({ - includeSystem: true, - restrictType: "exclude", - restrictCollections: [ "_users", "_graphs", "foo" ] - }); +```js +require("org/arangodb/replication").applier.properties({ + includeSystem: true, + restrictType: "exclude", + restrictCollections: [ "_users", "_graphs", "foo" ] +}); +``` diff --git a/Documentation/Books/Users/SUMMARY.md b/Documentation/Books/Users/SUMMARY.md index c7b94e3586..4090f3093e 100644 --- a/Documentation/Books/Users/SUMMARY.md +++ b/Documentation/Books/Users/SUMMARY.md @@ -6,7 +6,9 @@ * [Windows](Installing/Windows.md) * [Compiling](Installing/Compiling.md) * [Upgrading](Installing/Upgrading.md) - * [Incompatible changes](Upgrading/UpgradingChanges23.md) + * [Incompatible changes in 2.4](Upgrading/UpgradingChanges24.md) + * [Upgrading to 2.4](Upgrading/Upgrading24.md) + * [Incompatible changes in 2.3](Upgrading/UpgradingChanges23.md) * [Upgrading to 2.3](Upgrading/Upgrading23.md) * [Upgrading to 2.2](Upgrading/Upgrading22.md) * [Upgrading in general](Installing/Upgrading.md) diff --git a/Documentation/Books/Users/Upgrading/Upgrading24.mdpp b/Documentation/Books/Users/Upgrading/Upgrading24.mdpp new file mode 100644 index 0000000000..1e320820c6 --- /dev/null +++ b/Documentation/Books/Users/Upgrading/Upgrading24.mdpp @@ -0,0 +1,113 @@ +!CHAPTER Upgrading to ArangoDB 2.4 + +Please read the following sections if you upgrade from a previous version to +ArangoDB 2.4. Please be sure that you have checked the list of [changes in 2.4](../Upgrading/UpgradingChanges24.html) +before upgrading. + +Please note first that a database directory used with ArangoDB 2.4 +cannot be used with earlier versions (e.g. ArangoDB 2.3) any +more. Upgrading a database directory cannot be reverted. Therefore +please make sure to create a full backup of your existing ArangoDB +installation before performing an upgrade. + +!SECTION Database Directory Version Check and Upgrade + +ArangoDB will perform a database version check at startup. When ArangoDB 2.4 +encounters a database created with earlier versions of ArangoDB, it will refuse +to start. This is intentional. + +The output will then look like this: + +``` +2014-12-22T12:02:28Z [12001] ERROR In database '_system': Database directory version (20302) is lower than current version (20400). +2014-12-22T12:02:28Z [12001] ERROR In database '_system': ---------------------------------------------------------------------- +2014-12-22T12:02:28Z [12001] ERROR In database '_system': It seems like you have upgraded the ArangoDB binary. +2014-12-22T12:02:28Z [12001] ERROR In database '_system': If this is what you wanted to do, please restart with the +2014-12-22T12:02:28Z [12001] ERROR In database '_system': --upgrade +2014-12-22T12:02:28Z [12001] ERROR In database '_system': option to upgrade the data in the database directory. +2014-12-22T12:02:28Z [12001] ERROR In database '_system': Normally you can use the control script to upgrade your database +2014-12-22T12:02:28Z [12001] ERROR In database '_system': /etc/init.d/arangodb stop +2014-12-22T12:02:28Z [12001] ERROR In database '_system': /etc/init.d/arangodb upgrade +2014-12-22T12:02:28Z [12001] ERROR In database '_system': /etc/init.d/arangodb start +2014-12-22T12:02:28Z [12001] ERROR In database '_system': ---------------------------------------------------------------------- +2014-12-22T12:02:28Z [12001] FATAL Database '_system' needs upgrade. Please start the server with the --upgrade option +``` + +To make ArangoDB 2.4 start with a database directory created with an earlier +ArangoDB version, you may need to invoke the upgrade procedure once. This can +be done by running ArangoDB from the command line and supplying the `--upgrade` +option: + + unix> arangod data --upgrade + +where `data` is ArangoDB's main data directory. + +Note: here the same database should be specified that is also specified when +arangod is started regularly. Please do not run the `--upgrade` command on each +individual database subfolder (named `database-`). + +For example, if you regularly start your ArangoDB server with + + unix> arangod mydatabasefolder + +then running + + unix> arangod mydatabasefolder --upgrade + +will perform the upgrade for the whole ArangoDB instance, including all of its +databases. + +Starting with `--upgrade` will run a database version check and perform any +necessary migrations. As usual, you should create a backup of your database +directory before performing the upgrade. + +The last line of the output should look like this: +``` +2014-12-22T12:03:31Z [12026] INFO database upgrade passed +``` + +Please check the full output the `--upgrade` run. Upgrading may produce errors, which need +to be fixed before ArangoDB can be used properly. If no errors are present or +they have been resolved manually, you can start ArangoDB 2.4 regularly. + +!SECTION Upgrading a cluster planned in the web interface + +A cluster of ArangoDB instances has to be upgraded as well. This +involves upgrading all ArangoDB instances in the cluster, as well as +running the version check on the whole running cluster in the end. + +We have tried to make this procedure as painless and convenient for you. +We assume that you planned, launched and administrated a cluster using the +graphical front end in your browser. The upgrade procedure is then as +follows: + + 1. First shut down your cluster using the graphical front end as + usual. + + 2. Then upgrade all dispatcher instances on all machines in your + cluster using the version check as described above and restart them. + + 3. Now open the cluster dash board in your browser by pointing it to + the same dispatcher that you used to plan and launch the cluster in + the graphical front end. In addition to the usual buttons + "Relaunch", "Edit cluster plan" and "Delete cluster plan" you will + see another button marked "Upgrade and relaunch cluster". + + 4. Hit this button, your cluster will be upgraded and launched and + all is done for you behind the scenes. If all goes well, you will + see the usual cluster dash board after a few seconds. If there is + an error, you have to inspect the log files of your cluster + ArangoDB instances. Please let us know if you run into problems. + +There is an alternative way using the `ArangoDB` shell. Instead of +steps 3. and 4. above you can launch `arangosh`, point it to the dispatcher +that you have used to plan and launch the cluster using the option +``--server.endpoint``, and execute + + arangosh> require("org/arangodb/cluster").Upgrade("root",""); + +This upgrades the cluster and launches it, exactly as with the button +above in the graphical front end. You have to replace `"root"` with +a user name and `""` with a password that is valid for authentication +with the cluster. + diff --git a/Documentation/Books/Users/Upgrading/UpgradingChanges24.mdpp b/Documentation/Books/Users/Upgrading/UpgradingChanges24.mdpp new file mode 100644 index 0000000000..9d01eac7a1 --- /dev/null +++ b/Documentation/Books/Users/Upgrading/UpgradingChanges24.mdpp @@ -0,0 +1,187 @@ +!CHAPTER Incompatible changes in ArangoDB 2.4 + +It is recommended to check the following list of incompatible changes **before** +upgrading to ArangoDB 2.4, and adjust any client programs if necessary. + + +!SECTION Changed behavior + +!SUBSECTION V8 upgrade + +The bundled V8 version has been upgraded from 3.16.14 to 3.29.59. + +The new version provides better error checking, which can lead to subtle changes +in the execution of JavaScript code. + +The following code, though nonsense, runs without error in 2.3 and 2.4 when +strict mode is not enabled: + + (function () { + a = true; + a.foo = 1; + })(); + +When enabling strict mode, the function will throw an error in 2.4 but not in 2.3: + + (function () { + "use strict"; + a = true; + a.foo = 1; + })(); + + TypeError: Cannot assign to read only property 'foo' of true + +Though this is a change in behavior it can be considered an improvement. The new version actually +uncovers an error that went undetected in the old version. + +Error messages have also changed slightly in the new version. Applications that +rely on the exact error messages of the JavaScript engine may need to be adjusted so they +look for the updated error messages. + +!SUBSECTION Default endpoint + +The default endpoint for arangod is now `127.0.0.1`. + +This change will modify the IP address ArangoDB listens on to 127.0.0.1 by default. +This will make new ArangoDB installations unaccessible from clients other than +localhost unless the configuration is changed. This is a security feature. + +To make ArangoDB accessible from any client, change the server's configuration +(`--server.endpoint`) to either `tcp://0.0.0.0:8529` or the server's publicly +visible IP address. + +!SUBSECTION Replication + +System collections are now included in the replication and all replication API return +values by default. + +This will lead to user accounts and credentials data being replicated from master to +slave servers. This may overwrite slave-specific database users. + +This may be considered a feature or an anti-feature, so it is configurable. + +If replication of system collections is undesired, they can be excluded from replication +by setting the `includeSystem` attribute to `false` in the following commands: + +* initial synchronisation: `replication.sync({ includeSystem: false })` +* continuous replication: `replication.applier.properties({ includeSystem: false })` + +This will exclude all system collections (including `_aqlfunctions`, `_graphs` etc.) +from the initial synchronisation and the continuous replication. + +If this is also undesired, it is also possible to specify a list of collections to +exclude from the initial synchronisation and the continuous replication using the +`restrictCollections` attribute, e.g.: + + require("org/arangodb/replication").applier.properties({ + includeSystem: true, + restrictType: "exclude", + restrictCollections: [ "_users", "_graphs", "foo" ] + }); + +The above example will in general include system collections, but will exclude the +specified three collections from continuous replication. + +The HTTP REST API methods for fetching the replication inventory and for dumping +collections also support the `includeSystem` control flag via a URL parameter of +the same name. + +!SECTION Build process changes + +Several options for the `configure` command have been removed in 2.4. The options + +* `--enable-all-in-one-v8` +* `--enable-all-in-one-icu` +* `--enable-all-in-one-libev` +* `--with-libev=DIR` +* `--with-libev-lib=DIR` +* `--with-v8=DIR` +* `--with-v8-lib=DIR` +* `--with-icu-config=FILE` + +are not available anymore because the build process will always use the bundled +versions of the libraries. + +When building ArangoDB from source in a directory that already contained a pre-2.4 +version, it will be necessary to run a `make superclean` command once and a full +rebuild afterwards: + + git pull + make superclean + make setup + ./configure + make + +!SECTION Misceallaneous changes + +As a consequence of global renaming in the codebase, the option `mergeArrays` has +been renamed to `mergeObjects`. This option controls whether JSON objects will be +merged on an update operation or overwritten. The default has been, and still is, +to merge. Not specifying the parameter will lead to a merge, as it has been the +behavior in ArangoDB ever since. + +This affects the HTTP REST API method PATCH `/_api/document/collection/key`. Its +optional URL parameter `mergeArrays` for the option has been renamed to `mergeObjects`. + +The AQL `UPDATE` statement is also affected, as its option `mergeArrays` has also +been renamed to `mergeObjects`. The 2.3 query + + UPDATE doc IN collection WITH { ... } IN collection OPTIONS { mergeArrays: false } + +should thus be rewritten to the following in 2.4: + + UPDATE doc IN collection WITH { ... } IN collection OPTIONS { mergeObjects: false } + + +!SECTION Deprecated features + +For `FoxxController` objects, the method `collection()` is deprecated and will be +removed in future version of ArangoDB. Using this method will issue a warning. +Please use `applicationContext.collection()` instead. + +For `FoxxRepository` objects, the property `modelPrototype` is now deprecated. +Using it will issue a warning. Please use `FoxxRepository.model` instead. + +In `FoxxController` / `RequestContext`, calling method `bodyParam()` with three +arguments is deprecated. Please use `.bodyParam(paramName, options)` instead. + +In `FoxxController` / `RequestContext` calling method `queryParam({type: string})` +is deprecated. Please use `requestContext.queryParam({type: joi})` instead. + +In `FoxxController` / `RequestContext` calling method `pathParam({type: string})` +is deprecated. Please use `requestContext.pathParam({type: joi})` instead. + +For `FoxxModel`, calling `Model.extend({}, {attributes: {}})` is deprecated. +Please use `Model.extend({schema: {}})` instead. + +In module `org/arangodb/general-graph`, the functions `_undirectedRelation()` +and `_directedRelation()` are deprecated and will be removed in a future version +of ArangoDB. Both functions have been unified to `_relation()`. + +The modules `org/arangodb/graph` and `org/arangodb/graph-blueprint` are deprecated. +Please use module `org/arangodb/general-graph` instead. + +The HTTP REST API `_api/graph` and all its methods are deprecated. Please use +the general graph API `_api/gharial` instead. + + +!SECTION Removed features + +The following replication-related JavaScript methods became obsolete in ArangoDB +2.2 and have been removed in ArangoDB 2.4: + +* `require("org/arangodb/replication").logger.start()` +* `require("org/arangodb/replication").logger.stop()` +* `require("org/arangodb/replication").logger.properties()` + +The REST API methods for these functions have also been removed in ArangoDB 2.4: + +* HTTP PUT `/_api/replication/logger-start` +* HTTP PUT `/_api/replication/logger-stop` +* HTTP GET `/_api/replication/logger-config` +* HTTP PUT `/_api/replication/logger-config` + +Client applications that call one of these methods should be adjusted by removing +the calls to these methods. This shouldn't be problematic as these methods have +been no-ops since ArangoDB 2.2 anyway. + From 77b9bd695a107dea21c0f0dab830900b864ac93e Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Mon, 22 Dec 2014 16:14:57 +0100 Subject: [PATCH 2/4] bumped version number --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2fb2280275..4105e645c4 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Please kindly cite ArangoDB in your publications if it helps your research: ```bibtex @misc{ArangoDB2014, Author = {ArangoDB}, - Title = { {ArangoDB 2.3}: An Open source, multi-purpose database supporting flexible data models for documents, graphs, and key-values.}, + Title = { {ArangoDB 2.4}: An Open source, multi-purpose database supporting flexible data models for documents, graphs, and key-values.}, Year = {2014}, Howpublished = {\url{http://arangodb.com/} } From 406bd9980099e13e04a022f13efe44afd215462d Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Mon, 22 Dec 2014 16:15:16 +0100 Subject: [PATCH 3/4] added derived file --- .../frontend/js/bootstrap/module-internal.js | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/js/apps/system/aardvark/frontend/js/bootstrap/module-internal.js b/js/apps/system/aardvark/frontend/js/bootstrap/module-internal.js index 77c3367d81..46eae7aeb0 100644 --- a/js/apps/system/aardvark/frontend/js/bootstrap/module-internal.js +++ b/js/apps/system/aardvark/frontend/js/bootstrap/module-internal.js @@ -1175,37 +1175,20 @@ value.toString === Object.prototype.toString || (typeof value === 'object' && Object.getPrototypeOf(value) === null) ) { - var values, i, handled = false; + var handled = false; try { - if (value instanceof Set) { - // ES6 Set - values = [ ]; - for (i of value) { - values.push(i); - } - context.output += "[object Set "; - printArray(values, context); - context.output += "]"; - handled = true; - } - else if (value instanceof Map) { - // ES6 Map - values = { }; - for (i of value) { - values[i[0]] = i[1]; - } - context.output += "[object Map "; - printObject(values, context); - context.output += "]"; - handled = true; - } - else if (typeof value[Symbol.iterator] === "function") { + if (value instanceof Set || + value instanceof Map || + value instanceof WeakSet || + value instanceof WeakMap || + typeof value[Symbol.iterator] === "function") { // ES6 iterators context.output += value.toString(); handled = true; } } catch (err) { + // ignore any errors thrown above, and simply fall back to normal printing } if (! handled) { From b1150e7177a60f3eca15de53f0f926bbd612b3d0 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Mon, 22 Dec 2014 16:19:40 +0100 Subject: [PATCH 4/4] improve error message in case no suitable index is present for range query --- js/actions/api-simple.js | 5 +++-- js/server/modules/org/arangodb/simple-query.js | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/js/actions/api-simple.js b/js/actions/api-simple.js index 3d380f8810..199066da37 100644 --- a/js/actions/api-simple.js +++ b/js/actions/api-simple.js @@ -1702,8 +1702,9 @@ actions.defineHttp({ /// query. The response body contains an error document in this case. /// /// @RESTRETURNCODE{404} -/// is returned if the collection specified by *collection* is unknown. The -/// response body contains an error document in this case. +/// is returned if the collection specified by *collection* is unknown or no +/// suitable index for the range query is present. The response body contains +/// an error document in this case. /// /// @EXAMPLES /// diff --git a/js/server/modules/org/arangodb/simple-query.js b/js/server/modules/org/arangodb/simple-query.js index 73514c86a1..8a2e5e6a10 100644 --- a/js/server/modules/org/arangodb/simple-query.js +++ b/js/server/modules/org/arangodb/simple-query.js @@ -875,7 +875,10 @@ function rangedQuery (collection, attribute, left, right, type, skip, limit) { documents = collection.BY_CONDITION_SKIPLIST(idx.id, cond, skip, limit); } else { - throw "not implemented"; + var err = new ArangoError(); + err.errorNum = internal.errors.ERROR_ARANGO_NO_INDEX.code; + err.errorMessage = internal.errors.ERROR_ARANGO_NO_INDEX.message; + throw err; } }