From 238070b4776ad67e691cfd17dede973f649b5adc Mon Sep 17 00:00:00 2001 From: jsteemann Date: Mon, 13 Feb 2017 08:21:28 +0100 Subject: [PATCH] fixed code of some examples --- .../Books/AQL/ExecutionAndPerformance/Optimizer.mdpp | 1 + Documentation/Books/Manual/Indexing/Geo.mdpp | 1 + Documentation/DocuBlocks/collectionNear.md | 1 + js/server/modules/@arangodb/users.js | 5 +++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/Books/AQL/ExecutionAndPerformance/Optimizer.mdpp b/Documentation/Books/AQL/ExecutionAndPerformance/Optimizer.mdpp index 6722c29c05..098462f3ad 100644 --- a/Documentation/Books/AQL/ExecutionAndPerformance/Optimizer.mdpp +++ b/Documentation/Books/AQL/ExecutionAndPerformance/Optimizer.mdpp @@ -30,6 +30,7 @@ You may use it like this: (we disable syntax highlighting here) @startDocuBlockInline AQLEXP_01_axplainer @EXAMPLE_ARANGOSH_OUTPUT{AQLEXP_01_axplainer} ~addIgnoreCollection("test") + ~db._drop("test"); db._create("test"); for (i = 0; i < 100; ++i) { db.test.save({ value: i }); } db.test.ensureIndex({ type: "skiplist", fields: [ "value" ] }); diff --git a/Documentation/Books/Manual/Indexing/Geo.mdpp b/Documentation/Books/Manual/Indexing/Geo.mdpp index 99212e8fe1..5bde66271a 100644 --- a/Documentation/Books/Manual/Indexing/Geo.mdpp +++ b/Documentation/Books/Manual/Indexing/Geo.mdpp @@ -78,6 +78,7 @@ Create a geo index for a hash array attribute: @startDocuBlockInline geoIndexCreateForArrayAttribute2 @EXAMPLE_ARANGOSH_OUTPUT{geoIndexCreateForArrayAttribute2} + ~db._drop("geo2") ~db._create("geo2") db.geo2.ensureIndex({ type: "geo", fields: [ "location.latitude", "location.longitude" ] }); | for (i = -90; i <= 90; i += 10) { diff --git a/Documentation/DocuBlocks/collectionNear.md b/Documentation/DocuBlocks/collectionNear.md index ed3b52db3a..2ff883a524 100644 --- a/Documentation/DocuBlocks/collectionNear.md +++ b/Documentation/DocuBlocks/collectionNear.md @@ -49,6 +49,7 @@ FOR doc IN NEAR(@@collection, @latitude, @longitude, @limit) To get the nearest two locations: @EXAMPLE_ARANGOSH_OUTPUT{007_collectionNear} +~ db._drop("geo"); ~ db._create("geo"); db.geo.ensureIndex({ type: "geo", fields: [ "loc" ] }); |for (var i = -90; i <= 90; i += 10) { diff --git a/js/server/modules/@arangodb/users.js b/js/server/modules/@arangodb/users.js index 51646155f4..2e4747d220 100644 --- a/js/server/modules/@arangodb/users.js +++ b/js/server/modules/@arangodb/users.js @@ -40,11 +40,12 @@ const ArangoError = arangodb.ArangoError; // converts a user document to the legacy format const convertToLegacyFormat = function (doc) { + let ad = doc.authData || {}; return { user: doc.user, - active: doc.authData.active, + active: ad.active, extra: doc.userData || {}, - changePassword: doc.authData.changePassword + changePassword: ad.changePassword }; };