mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'spdvpk' of github.com:arangodb/arangodb into spdvpk
This commit is contained in:
commit
2f5f81cbc5
|
@ -46,7 +46,6 @@ struct QueryResult {
|
||||||
|
|
||||||
bindParameters = other.bindParameters;
|
bindParameters = other.bindParameters;
|
||||||
collectionNames = other.collectionNames;
|
collectionNames = other.collectionNames;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryResult(int code, std::string const& details)
|
QueryResult(int code, std::string const& details)
|
||||||
|
@ -61,8 +60,7 @@ struct QueryResult {
|
||||||
|
|
||||||
QueryResult() : QueryResult(TRI_ERROR_NO_ERROR) {}
|
QueryResult() : QueryResult(TRI_ERROR_NO_ERROR) {}
|
||||||
|
|
||||||
virtual ~QueryResult() {
|
virtual ~QueryResult() {}
|
||||||
}
|
|
||||||
|
|
||||||
int code;
|
int code;
|
||||||
bool cached;
|
bool cached;
|
||||||
|
|
|
@ -249,7 +249,6 @@ add_executable(${BIN_ARANGOD}
|
||||||
V8Server/v8-vocindex.cpp
|
V8Server/v8-vocindex.cpp
|
||||||
VocBase/DatafileStatistics.cpp
|
VocBase/DatafileStatistics.cpp
|
||||||
VocBase/Ditch.cpp
|
VocBase/Ditch.cpp
|
||||||
VocBase/DocumentAccessor.cpp
|
|
||||||
VocBase/ExampleMatcher.cpp
|
VocBase/ExampleMatcher.cpp
|
||||||
VocBase/Graphs.cpp
|
VocBase/Graphs.cpp
|
||||||
VocBase/KeyGenerator.cpp
|
VocBase/KeyGenerator.cpp
|
||||||
|
|
|
@ -300,7 +300,7 @@ bool ClusterTraverser::vertexMatchesCondition(
|
||||||
std::vector<arangodb::traverser::TraverserExpression*> const& exp) {
|
std::vector<arangodb::traverser::TraverserExpression*> const& exp) {
|
||||||
for (auto const& e : exp) {
|
for (auto const& e : exp) {
|
||||||
if (!e->isEdgeAccess) {
|
if (!e->isEdgeAccess) {
|
||||||
if (v.isNone() || !e->matchesCheck(v)) {
|
if (v.isNone() || !e->matchesCheck(_trx, v)) {
|
||||||
++_filteredPaths;
|
++_filteredPaths;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ bool RestEdgesHandler::getEdgesForVertex(
|
||||||
if (!expressions.empty()) {
|
if (!expressions.empty()) {
|
||||||
for (auto& exp : expressions) {
|
for (auto& exp : expressions) {
|
||||||
if (exp->isEdgeAccess &&
|
if (exp->isEdgeAccess &&
|
||||||
!exp->matchesCheck(edge)) {
|
!exp->matchesCheck(&trx, edge)) {
|
||||||
++filtered;
|
++filtered;
|
||||||
add = false;
|
add = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "Basics/ScopeGuard.h"
|
#include "Basics/ScopeGuard.h"
|
||||||
#include "Basics/VelocyPackHelper.h"
|
#include "Basics/VelocyPackHelper.h"
|
||||||
#include "Basics/VPackStringBufferAdapter.h"
|
#include "Basics/VPackStringBufferAdapter.h"
|
||||||
|
#include "Utils/SingleCollectionTransaction.h"
|
||||||
#include "VocBase/Traverser.h"
|
#include "VocBase/Traverser.h"
|
||||||
|
|
||||||
#include <velocypack/Builder.h>
|
#include <velocypack/Builder.h>
|
||||||
|
@ -395,12 +396,16 @@ void RestSimpleHandler::lookupByKeys(VPackSlice const& slice) {
|
||||||
result.add(VPackValue("documents"));
|
result.add(VPackValue("documents"));
|
||||||
std::vector<std::string> filteredIds;
|
std::vector<std::string> filteredIds;
|
||||||
|
|
||||||
|
#warning TODO: fixme
|
||||||
|
// just needed to build the result
|
||||||
|
SingleCollectionTransaction trx(StandaloneTransactionContext::Create(_vocbase), collectionName, TRI_TRANSACTION_READ);
|
||||||
|
|
||||||
result.openArray();
|
result.openArray();
|
||||||
for (auto const& tmp : VPackArrayIterator(qResult)) {
|
for (auto const& tmp : VPackArrayIterator(qResult)) {
|
||||||
if (!tmp.isNone()) {
|
if (!tmp.isNone()) {
|
||||||
bool add = true;
|
bool add = true;
|
||||||
for (auto& e : expressions) {
|
for (auto& e : expressions) {
|
||||||
if (!e->isEdgeAccess && !e->matchesCheck(tmp)) {
|
if (!e->isEdgeAccess && !e->matchesCheck(&trx, tmp)) {
|
||||||
add = false;
|
add = false;
|
||||||
std::string _id =
|
std::string _id =
|
||||||
arangodb::basics::VelocyPackHelper::checkAndGetStringValue(
|
arangodb::basics::VelocyPackHelper::checkAndGetStringValue(
|
||||||
|
|
|
@ -849,7 +849,7 @@ bool DepthFirstTraverser::edgeMatchesConditions(VPackSlice e, size_t depth) {
|
||||||
for (auto const& exp : it->second) {
|
for (auto const& exp : it->second) {
|
||||||
TRI_ASSERT(exp != nullptr);
|
TRI_ASSERT(exp != nullptr);
|
||||||
|
|
||||||
if (exp->isEdgeAccess && !exp->matchesCheck(e)) {
|
if (exp->isEdgeAccess && !exp->matchesCheck(_trx, e)) {
|
||||||
++_filteredPaths;
|
++_filteredPaths;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -891,7 +891,7 @@ bool DepthFirstTraverser::vertexMatchesConditions(std::string const& v,
|
||||||
vertex = it->second;
|
vertex = it->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!exp->matchesCheck(VPackSlice(vertex->data()))) {
|
if (!exp->matchesCheck(_trx, VPackSlice(vertex->data()))) {
|
||||||
++_filteredPaths;
|
++_filteredPaths;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -942,7 +942,7 @@ void DepthFirstTraverser::setStartVertex(
|
||||||
vertex = result.buffer;
|
vertex = result.buffer;
|
||||||
_vertices.emplace(v, vertex);
|
_vertices.emplace(v, vertex);
|
||||||
}
|
}
|
||||||
if (!exp->matchesCheck(VPackSlice(vertex->data()))) {
|
if (!exp->matchesCheck(_trx, VPackSlice(vertex->data()))) {
|
||||||
++_filteredPaths;
|
++_filteredPaths;
|
||||||
_done = true;
|
_done = true;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,418 +0,0 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// DISCLAIMER
|
|
||||||
///
|
|
||||||
/// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany
|
|
||||||
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
|
|
||||||
///
|
|
||||||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
/// you may not use this file except in compliance with the License.
|
|
||||||
/// You may obtain a copy of the License at
|
|
||||||
///
|
|
||||||
/// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
///
|
|
||||||
/// Unless required by applicable law or agreed to in writing, software
|
|
||||||
/// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
/// See the License for the specific language governing permissions and
|
|
||||||
/// limitations under the License.
|
|
||||||
///
|
|
||||||
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
|
||||||
///
|
|
||||||
/// @author Jan Steemann
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#include "DocumentAccessor.h"
|
|
||||||
#include "Basics/conversions.h"
|
|
||||||
#include "Basics/Exceptions.h"
|
|
||||||
#include "Basics/VelocyPackHelper.h"
|
|
||||||
#include "Utils/CollectionNameResolver.h"
|
|
||||||
|
|
||||||
DocumentAccessor::DocumentAccessor(
|
|
||||||
arangodb::CollectionNameResolver const* resolver,
|
|
||||||
TRI_document_collection_t* document, TRI_doc_mptr_t const* mptr)
|
|
||||||
: _resolver(resolver),
|
|
||||||
_document(document),
|
|
||||||
_mptr(mptr),
|
|
||||||
_json(),
|
|
||||||
_current(nullptr) {
|
|
||||||
TRI_ASSERT(mptr != nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
DocumentAccessor::DocumentAccessor(TRI_json_t const* json)
|
|
||||||
: _resolver(nullptr),
|
|
||||||
_document(nullptr),
|
|
||||||
_mptr(nullptr),
|
|
||||||
_json(),
|
|
||||||
_current(json) {
|
|
||||||
TRI_ASSERT(_current != nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
DocumentAccessor::DocumentAccessor(VPackSlice const& slice)
|
|
||||||
: _resolver(nullptr),
|
|
||||||
_document(nullptr),
|
|
||||||
_mptr(nullptr),
|
|
||||||
_json(),
|
|
||||||
_current(nullptr) {
|
|
||||||
_current = arangodb::basics::VelocyPackHelper::velocyPackToJson(slice);
|
|
||||||
TRI_ASSERT(_current != nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
DocumentAccessor::~DocumentAccessor() {}
|
|
||||||
|
|
||||||
bool DocumentAccessor::hasKey(std::string const& attribute) const {
|
|
||||||
if (!isObject()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_current == nullptr) {
|
|
||||||
if (attribute.size() > 1 && attribute[0] == '_') {
|
|
||||||
if (attribute == TRI_VOC_ATTRIBUTE_ID ||
|
|
||||||
attribute == TRI_VOC_ATTRIBUTE_KEY ||
|
|
||||||
attribute == TRI_VOC_ATTRIBUTE_REV) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
// TODO
|
|
||||||
if (TRI_IS_EDGE_MARKER(_mptr) && (attribute == TRI_VOC_ATTRIBUTE_FROM ||
|
|
||||||
attribute == TRI_VOC_ATTRIBUTE_TO)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (TRI_LookupObjectJson(_current, attribute.c_str()) != nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DocumentAccessor::isObject() const {
|
|
||||||
if (_current != nullptr) {
|
|
||||||
return TRI_IsObjectJson(_current);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ok, must be a document/edge
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DocumentAccessor::isArray() const {
|
|
||||||
if (_current != nullptr) {
|
|
||||||
return TRI_IsArrayJson(_current);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ok, must be a document/edge
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t DocumentAccessor::length() const {
|
|
||||||
if (!isArray()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
// ok, we have confirmed this is an array
|
|
||||||
TRI_ASSERT(_current != nullptr);
|
|
||||||
if (_current != nullptr) {
|
|
||||||
return TRI_LengthArrayJson(_current);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DocumentAccessor& DocumentAccessor::get(std::string const& name) {
|
|
||||||
return get(name.c_str(), name.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
DocumentAccessor& DocumentAccessor::get(char const* name, size_t nameLength) {
|
|
||||||
if (_current == nullptr) {
|
|
||||||
// a document, we need the access its attributes using special methods
|
|
||||||
lookupDocumentAttribute(name, nameLength);
|
|
||||||
} else {
|
|
||||||
// already a JSON
|
|
||||||
lookupJsonAttribute(name, nameLength);
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
DocumentAccessor& DocumentAccessor::at(int64_t index) {
|
|
||||||
if (isArray()) {
|
|
||||||
size_t length = TRI_LengthArrayJson(_current);
|
|
||||||
|
|
||||||
if (index < 0) {
|
|
||||||
// a negative position is allowed
|
|
||||||
index = static_cast<int64_t>(length) + index;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index >= 0 && index < static_cast<int64_t>(length)) {
|
|
||||||
// only look up the value if it is within array bounds
|
|
||||||
TRI_json_t const* found =
|
|
||||||
TRI_LookupArrayJson(_current, static_cast<size_t>(index));
|
|
||||||
|
|
||||||
if (found != nullptr) {
|
|
||||||
_current = found;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// fall-through intentional
|
|
||||||
}
|
|
||||||
|
|
||||||
setToNull();
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
arangodb::basics::Json DocumentAccessor::toJson() {
|
|
||||||
#if 0
|
|
||||||
if (_current == nullptr) {
|
|
||||||
// we're still pointing to the original document
|
|
||||||
auto shaper = _document->getShaper();
|
|
||||||
|
|
||||||
// fetch document from mptr
|
|
||||||
TRI_shaped_json_t shaped;
|
|
||||||
TRI_EXTRACT_SHAPED_JSON_MARKER(shaped, _mptr->getDataPtr());
|
|
||||||
arangodb::basics::Json json(shaper->memoryZone(),
|
|
||||||
TRI_JsonShapedJson(shaper, &shaped));
|
|
||||||
|
|
||||||
// add internal attributes
|
|
||||||
|
|
||||||
// _id, _key, _rev
|
|
||||||
char const* key = TRI_EXTRACT_MARKER_KEY(_mptr);
|
|
||||||
std::string id(_resolver->getCollectionName(_document->_info.id()));
|
|
||||||
id.push_back('/');
|
|
||||||
id.append(key);
|
|
||||||
json(TRI_VOC_ATTRIBUTE_ID, arangodb::basics::Json(id));
|
|
||||||
json(TRI_VOC_ATTRIBUTE_REV,
|
|
||||||
arangodb::basics::Json(std::to_string(TRI_EXTRACT_MARKER_RID(_mptr))));
|
|
||||||
json(TRI_VOC_ATTRIBUTE_KEY, arangodb::basics::Json(key));
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
// TODO
|
|
||||||
if (TRI_IS_EDGE_MARKER(_mptr)) {
|
|
||||||
// _from
|
|
||||||
std::string from(_resolver->getCollectionNameCluster(
|
|
||||||
TRI_EXTRACT_MARKER_FROM_CID(_mptr)));
|
|
||||||
from.push_back('/');
|
|
||||||
from.append(TRI_EXTRACT_MARKER_FROM_KEY(_mptr));
|
|
||||||
json(TRI_VOC_ATTRIBUTE_FROM, arangodb::basics::Json(from));
|
|
||||||
|
|
||||||
// _to
|
|
||||||
std::string to(_resolver->getCollectionNameCluster(
|
|
||||||
TRI_EXTRACT_MARKER_TO_CID(_mptr)));
|
|
||||||
to.push_back('/');
|
|
||||||
to.append(TRI_EXTRACT_MARKER_TO_KEY(_mptr));
|
|
||||||
json(TRI_VOC_ATTRIBUTE_TO, arangodb::basics::Json(to));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return json;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_current == _json.get()) {
|
|
||||||
// _current points at the JSON that we own
|
|
||||||
|
|
||||||
// steal the JSON
|
|
||||||
TRI_json_t* value = _json.release();
|
|
||||||
setToNull();
|
|
||||||
return arangodb::basics::Json(TRI_UNKNOWN_MEM_ZONE, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
TRI_json_t* copy = TRI_CopyJson(TRI_UNKNOWN_MEM_ZONE, _current);
|
|
||||||
|
|
||||||
if (copy != nullptr) {
|
|
||||||
_json.release();
|
|
||||||
return arangodb::basics::Json(TRI_UNKNOWN_MEM_ZONE, copy);
|
|
||||||
}
|
|
||||||
// fall-through intentional
|
|
||||||
#endif
|
|
||||||
return arangodb::basics::Json(arangodb::basics::Json::Null);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DocumentAccessor::setToNull() {
|
|
||||||
// check if already null
|
|
||||||
if (_current != nullptr && _current->_type == TRI_JSON_NULL) {
|
|
||||||
// already null. done!
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_json.reset(TRI_CreateNullJson(TRI_UNKNOWN_MEM_ZONE));
|
|
||||||
if (_json.get() == nullptr) {
|
|
||||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY);
|
|
||||||
}
|
|
||||||
|
|
||||||
_current = _json.get();
|
|
||||||
TRI_ASSERT(_current != nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DocumentAccessor::lookupJsonAttribute(char const* name,
|
|
||||||
size_t nameLength) {
|
|
||||||
TRI_ASSERT(_current != nullptr);
|
|
||||||
|
|
||||||
if (!isObject()) {
|
|
||||||
setToNull();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRI_json_t const* value = TRI_LookupObjectJson(_current, name);
|
|
||||||
|
|
||||||
if (value == nullptr) {
|
|
||||||
// attribute not found
|
|
||||||
setToNull();
|
|
||||||
} else {
|
|
||||||
// found
|
|
||||||
_current = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DocumentAccessor::lookupDocumentAttribute(char const* name,
|
|
||||||
size_t nameLength) {
|
|
||||||
if (*name == '_' && name[1] != '\0') {
|
|
||||||
if (name[1] == 'k' && nameLength == 4 &&
|
|
||||||
memcmp(name, TRI_VOC_ATTRIBUTE_KEY, nameLength) == 0) {
|
|
||||||
// _key value is copied into JSON
|
|
||||||
char const* key = TRI_EXTRACT_MARKER_KEY(_mptr);
|
|
||||||
if (key == nullptr) {
|
|
||||||
setToNull();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_json.reset(
|
|
||||||
TRI_CreateStringCopyJson(TRI_UNKNOWN_MEM_ZONE, key, strlen(key)));
|
|
||||||
|
|
||||||
if (_json.get() == nullptr) {
|
|
||||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY);
|
|
||||||
}
|
|
||||||
|
|
||||||
_current = _json.get();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name[1] == 'i' && nameLength == 3 &&
|
|
||||||
memcmp(name, TRI_VOC_ATTRIBUTE_ID, nameLength) == 0) {
|
|
||||||
// _id
|
|
||||||
char buffer[512]; // big enough for max key length + max collection name
|
|
||||||
// length
|
|
||||||
size_t pos =
|
|
||||||
_resolver->getCollectionName(&buffer[0], _document->_info.id());
|
|
||||||
buffer[pos++] = '/';
|
|
||||||
char const* key = TRI_EXTRACT_MARKER_KEY(_mptr);
|
|
||||||
if (key == nullptr) {
|
|
||||||
setToNull();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
size_t len = strlen(key);
|
|
||||||
memcpy(&buffer[pos], key, len);
|
|
||||||
buffer[pos + len] = '\0';
|
|
||||||
_json.reset(TRI_CreateStringCopyJson(TRI_UNKNOWN_MEM_ZONE, &buffer[0],
|
|
||||||
pos + len));
|
|
||||||
if (_json.get() == nullptr) {
|
|
||||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY);
|
|
||||||
}
|
|
||||||
_current = _json.get();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (name[1] == 'r' && nameLength == 4 &&
|
|
||||||
memcmp(name, TRI_VOC_ATTRIBUTE_REV, nameLength) == 0) {
|
|
||||||
// _rev
|
|
||||||
char buffer[21];
|
|
||||||
TRI_voc_rid_t rid = TRI_EXTRACT_MARKER_RID(_mptr);
|
|
||||||
size_t len = TRI_StringUInt64InPlace(rid, &buffer[0]);
|
|
||||||
_json.reset(
|
|
||||||
TRI_CreateStringCopyJson(TRI_UNKNOWN_MEM_ZONE, &buffer[0], len));
|
|
||||||
if (_json.get() == nullptr) {
|
|
||||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY);
|
|
||||||
}
|
|
||||||
_current = _json.get();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
// TODO
|
|
||||||
if (TRI_IS_EDGE_MARKER(_mptr)) {
|
|
||||||
if (name[1] == 'f' && nameLength == 5 &&
|
|
||||||
memcmp(name, TRI_VOC_ATTRIBUTE_FROM, nameLength) == 0) {
|
|
||||||
// _from
|
|
||||||
char buffer[512]; // big enough for max key length + max collection
|
|
||||||
// name length
|
|
||||||
size_t pos = _resolver->getCollectionNameCluster(
|
|
||||||
&buffer[0], TRI_EXTRACT_MARKER_FROM_CID(_mptr));
|
|
||||||
buffer[pos++] = '/';
|
|
||||||
char const* key = TRI_EXTRACT_MARKER_FROM_KEY(_mptr);
|
|
||||||
if (key == nullptr) {
|
|
||||||
setToNull();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
size_t len = strlen(key);
|
|
||||||
memcpy(&buffer[pos], key, len);
|
|
||||||
buffer[pos + len] = '\0';
|
|
||||||
_json.reset(TRI_CreateStringCopyJson(TRI_UNKNOWN_MEM_ZONE, &buffer[0],
|
|
||||||
pos + len));
|
|
||||||
if (_json.get() == nullptr) {
|
|
||||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY);
|
|
||||||
}
|
|
||||||
_current = _json.get();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name[1] == 't' && nameLength == 3 &&
|
|
||||||
memcmp(name, TRI_VOC_ATTRIBUTE_TO, nameLength) == 0) {
|
|
||||||
// to
|
|
||||||
char buffer[512]; // big enough for max key length + max collection
|
|
||||||
// name length
|
|
||||||
size_t pos = _resolver->getCollectionNameCluster(
|
|
||||||
&buffer[0], TRI_EXTRACT_MARKER_TO_CID(_mptr));
|
|
||||||
buffer[pos++] = '/';
|
|
||||||
char const* key = TRI_EXTRACT_MARKER_TO_KEY(_mptr);
|
|
||||||
if (key == nullptr) {
|
|
||||||
setToNull();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
size_t len = strlen(key);
|
|
||||||
memcpy(&buffer[pos], key, len);
|
|
||||||
buffer[pos + len] = '\0';
|
|
||||||
_json.reset(TRI_CreateStringCopyJson(TRI_UNKNOWN_MEM_ZONE, &buffer[0],
|
|
||||||
pos + len));
|
|
||||||
if (_json.get() == nullptr) {
|
|
||||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY);
|
|
||||||
}
|
|
||||||
_current = _json.get();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// fall-through intentional
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
auto shaper = _document->getShaper();
|
|
||||||
|
|
||||||
TRI_shape_pid_t pid = shaper->lookupAttributePathByName(name);
|
|
||||||
|
|
||||||
if (pid == 0) {
|
|
||||||
// attribute does not exist
|
|
||||||
setToNull();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// attribute exists
|
|
||||||
TRI_shaped_json_t document;
|
|
||||||
TRI_EXTRACT_SHAPED_JSON_MARKER(document, _mptr->getDataPtr());
|
|
||||||
|
|
||||||
TRI_shaped_json_t json;
|
|
||||||
TRI_shape_t const* shape;
|
|
||||||
|
|
||||||
bool ok = shaper->extractShapedJson(&document, 0, pid, &json, &shape);
|
|
||||||
|
|
||||||
if (ok && shape != nullptr) {
|
|
||||||
_json.reset(TRI_JsonShapedJson(shaper, &json));
|
|
||||||
if (_json.get() == nullptr) {
|
|
||||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY);
|
|
||||||
}
|
|
||||||
_current = _json.get();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// not found
|
|
||||||
setToNull();
|
|
||||||
}
|
|
|
@ -1,125 +0,0 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// DISCLAIMER
|
|
||||||
///
|
|
||||||
/// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany
|
|
||||||
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
|
|
||||||
///
|
|
||||||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
/// you may not use this file except in compliance with the License.
|
|
||||||
/// You may obtain a copy of the License at
|
|
||||||
///
|
|
||||||
/// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
///
|
|
||||||
/// Unless required by applicable law or agreed to in writing, software
|
|
||||||
/// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
/// See the License for the specific language governing permissions and
|
|
||||||
/// limitations under the License.
|
|
||||||
///
|
|
||||||
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
|
||||||
///
|
|
||||||
/// @author Jan Steemann
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef ARANGOD_VOC_BASE_DOCUMENT_ACCESSOR_H
|
|
||||||
#define ARANGOD_VOC_BASE_DOCUMENT_ACCESSOR_H 1
|
|
||||||
|
|
||||||
#include "Basics/Common.h"
|
|
||||||
#include "Basics/JsonHelper.h"
|
|
||||||
#include "Utils/Transaction.h"
|
|
||||||
#include "VocBase/document-collection.h"
|
|
||||||
#include "Wal/Marker.h"
|
|
||||||
|
|
||||||
#include <velocypack/Options.h>
|
|
||||||
#include <velocypack/Slice.h>
|
|
||||||
#include <velocypack/velocypack-aliases.h>
|
|
||||||
|
|
||||||
struct TRI_doc_mptr_t;
|
|
||||||
|
|
||||||
namespace arangodb {
|
|
||||||
class CollectionNameResolver;
|
|
||||||
}
|
|
||||||
|
|
||||||
class DocumentAccessor {
|
|
||||||
public:
|
|
||||||
DocumentAccessor(DocumentAccessor const&);
|
|
||||||
DocumentAccessor& operator=(DocumentAccessor const&);
|
|
||||||
|
|
||||||
DocumentAccessor(arangodb::CollectionNameResolver const* resolver,
|
|
||||||
TRI_document_collection_t* document,
|
|
||||||
TRI_doc_mptr_t const* mptr);
|
|
||||||
|
|
||||||
explicit DocumentAccessor(TRI_json_t const* json);
|
|
||||||
explicit DocumentAccessor(VPackSlice const& slice);
|
|
||||||
|
|
||||||
~DocumentAccessor();
|
|
||||||
|
|
||||||
public:
|
|
||||||
bool hasKey(std::string const& attribute) const;
|
|
||||||
|
|
||||||
bool isObject() const;
|
|
||||||
|
|
||||||
bool isArray() const;
|
|
||||||
|
|
||||||
size_t length() const;
|
|
||||||
|
|
||||||
DocumentAccessor& get(char const* name, size_t nameLength);
|
|
||||||
|
|
||||||
DocumentAccessor& get(std::string const& name);
|
|
||||||
|
|
||||||
DocumentAccessor& at(int64_t index);
|
|
||||||
|
|
||||||
arangodb::basics::Json toJson();
|
|
||||||
|
|
||||||
private:
|
|
||||||
void setToNull();
|
|
||||||
|
|
||||||
void lookupJsonAttribute(char const* name, size_t nameLength);
|
|
||||||
|
|
||||||
void lookupDocumentAttribute(char const* name, size_t nameLength);
|
|
||||||
|
|
||||||
private:
|
|
||||||
arangodb::CollectionNameResolver const* _resolver;
|
|
||||||
|
|
||||||
TRI_document_collection_t* _document;
|
|
||||||
|
|
||||||
TRI_doc_mptr_t const* _mptr;
|
|
||||||
|
|
||||||
std::unique_ptr<TRI_json_t> _json; // the JSON that we own
|
|
||||||
|
|
||||||
TRI_json_t const* _current; // the JSON that we point to
|
|
||||||
};
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief extracts the key from a marker
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
static inline std::string TRI_EXTRACT_MARKER_KEY(
|
|
||||||
arangodb::Transaction* trx, TRI_df_marker_t const* marker) {
|
|
||||||
#if 0
|
|
||||||
if (marker->_type == TRI_DF_MARKER_VPACK_DOCUMENT) {
|
|
||||||
auto b = reinterpret_cast<char const*>(marker) +
|
|
||||||
sizeof(arangodb::wal::vpack_document_marker_t);
|
|
||||||
VPackSlice slice(reinterpret_cast<uint8_t const*>(b));
|
|
||||||
return slice.get(TRI_VOC_ATTRIBUTE_KEY).copyString();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
|
||||||
// invalid marker type
|
|
||||||
TRI_ASSERT(false);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief extracts the key from a marker
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
static inline std::string TRI_EXTRACT_MARKER_KEY(arangodb::Transaction* trx,
|
|
||||||
TRI_doc_mptr_t const* mptr) {
|
|
||||||
return TRI_EXTRACT_MARKER_KEY(
|
|
||||||
trx, static_cast<TRI_df_marker_t const*>(mptr->getDataPtr()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -25,6 +25,8 @@
|
||||||
#include "Basics/VelocyPackHelper.h"
|
#include "Basics/VelocyPackHelper.h"
|
||||||
#include "Basics/json-utilities.h"
|
#include "Basics/json-utilities.h"
|
||||||
#include "Indexes/EdgeIndex.h"
|
#include "Indexes/EdgeIndex.h"
|
||||||
|
#include "Utils/Transaction.h"
|
||||||
|
#include "Utils/TransactionContext.h"
|
||||||
#include "VocBase/KeyGenerator.h"
|
#include "VocBase/KeyGenerator.h"
|
||||||
|
|
||||||
using TraverserExpression = arangodb::traverser::TraverserExpression;
|
using TraverserExpression = arangodb::traverser::TraverserExpression;
|
||||||
|
@ -150,15 +152,15 @@ TraverserExpression::TraverserExpression(VPackSlice const& slice) {
|
||||||
basics::VelocyPackHelper::velocyPackToJson(slice.get("varAccess")),
|
basics::VelocyPackHelper::velocyPackToJson(slice.get("varAccess")),
|
||||||
arangodb::basics::Json::AUTOFREE);
|
arangodb::basics::Json::AUTOFREE);
|
||||||
|
|
||||||
compareTo.reset(new arangodb::basics::Json(
|
VPackSlice compareToSlice = slice.get("compareTo");
|
||||||
TRI_UNKNOWN_MEM_ZONE,
|
VPackBuilder* builder = new VPackBuilder;
|
||||||
basics::VelocyPackHelper::velocyPackToJson(slice.get("compareTo")),
|
try {
|
||||||
arangodb::basics::Json::AUTOFREE));
|
builder->add(compareToSlice);
|
||||||
|
} catch (...) {
|
||||||
if (compareTo->json() == nullptr) {
|
delete builder;
|
||||||
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL,
|
throw;
|
||||||
"invalid compareTo value");
|
|
||||||
}
|
}
|
||||||
|
compareTo.reset(builder);
|
||||||
// If this fails everything before does not leak
|
// If this fails everything before does not leak
|
||||||
varAccess = new aql::AstNode(registerNode, registerString, varNode);
|
varAccess = new aql::AstNode(registerNode, registerString, varNode);
|
||||||
}
|
}
|
||||||
|
@ -170,13 +172,17 @@ TraverserExpression::TraverserExpression(VPackSlice const& slice) {
|
||||||
void TraverserExpression::toJson(arangodb::basics::Json& json,
|
void TraverserExpression::toJson(arangodb::basics::Json& json,
|
||||||
TRI_memory_zone_t* zone) const {
|
TRI_memory_zone_t* zone) const {
|
||||||
json("isEdgeAccess", arangodb::basics::Json(isEdgeAccess))(
|
json("isEdgeAccess", arangodb::basics::Json(isEdgeAccess))(
|
||||||
"comparisonType",
|
"comparisonType",
|
||||||
arangodb::basics::Json(static_cast<int32_t>(comparisonType)))(
|
arangodb::basics::Json(static_cast<int32_t>(comparisonType)))(
|
||||||
"varAccess", varAccess->toJson(zone, true));
|
"varAccess", varAccess->toJson(zone, true));
|
||||||
|
|
||||||
if (compareTo.get() != nullptr) {
|
if (compareTo != nullptr) {
|
||||||
// We have to copy compareTo. The json is greedy and steals it...
|
// We have to copy compareTo. The json is greedy and steals it...
|
||||||
json("compareTo", compareTo->copy());
|
TRI_json_t* extracted = arangodb::basics::VelocyPackHelper::velocyPackToJson(compareTo->slice());
|
||||||
|
if (extracted == nullptr) {
|
||||||
|
THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY);
|
||||||
|
}
|
||||||
|
json("compareTo", arangodb::basics::Json(TRI_UNKNOWN_MEM_ZONE, TRI_CopyJson(TRI_UNKNOWN_MEM_ZONE, extracted)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,22 +192,20 @@ void TraverserExpression::toJson(arangodb::basics::Json& json,
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool TraverserExpression::recursiveCheck(arangodb::aql::AstNode const* node,
|
bool TraverserExpression::recursiveCheck(arangodb::aql::AstNode const* node,
|
||||||
DocumentAccessor& accessor) const {
|
arangodb::velocypack::Slice& element) const {
|
||||||
switch (node->type) {
|
switch (node->type) {
|
||||||
case arangodb::aql::NODE_TYPE_REFERENCE:
|
case arangodb::aql::NODE_TYPE_REFERENCE:
|
||||||
// We are on the variable access
|
// We are on the variable access
|
||||||
return true;
|
return true;
|
||||||
case arangodb::aql::NODE_TYPE_ATTRIBUTE_ACCESS: {
|
case arangodb::aql::NODE_TYPE_ATTRIBUTE_ACCESS: {
|
||||||
char const* attributeName = node->getStringValue();
|
std::string name(node->getString());
|
||||||
TRI_ASSERT(attributeName != nullptr);
|
if (!recursiveCheck(node->getMember(0), element)) {
|
||||||
std::string name(attributeName, node->getStringLength());
|
|
||||||
if (!recursiveCheck(node->getMember(0), accessor)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!accessor.isObject() || !accessor.hasKey(name)) {
|
if (!element.isObject() || !element.hasKey(name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
accessor.get(name);
|
element = element.get(name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case arangodb::aql::NODE_TYPE_INDEXED_ACCESS: {
|
case arangodb::aql::NODE_TYPE_INDEXED_ACCESS: {
|
||||||
|
@ -209,14 +213,14 @@ bool TraverserExpression::recursiveCheck(arangodb::aql::AstNode const* node,
|
||||||
if (!index->isIntValue()) {
|
if (!index->isIntValue()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!recursiveCheck(node->getMember(0), accessor)) {
|
if (!recursiveCheck(node->getMember(0), element)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
auto idx = index->getIntValue();
|
auto idx = index->getIntValue();
|
||||||
if (!accessor.isArray()) {
|
if (!element.isArray()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
accessor.at(idx);
|
element = element.at(idx);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -226,64 +230,41 @@ bool TraverserExpression::recursiveCheck(arangodb::aql::AstNode const* node,
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief evalutes if an element matches the given expression
|
/// @brief evaluates if an element matches the given expression
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool TraverserExpression::matchesCheck(DocumentAccessor& accessor) const {
|
bool TraverserExpression::matchesCheck(arangodb::Transaction* trx,
|
||||||
arangodb::basics::Json result(arangodb::basics::Json::Null);
|
VPackSlice const& element) const {
|
||||||
if (recursiveCheck(varAccess, accessor)) {
|
TRI_ASSERT(trx != nullptr);
|
||||||
result = accessor.toJson();
|
|
||||||
|
VPackSlice value = element;
|
||||||
|
|
||||||
|
// initialize compare value to Null
|
||||||
|
VPackSlice result = arangodb::basics::VelocyPackHelper::NullValue();
|
||||||
|
// perform recursive check. this may modify value
|
||||||
|
if (recursiveCheck(varAccess, value)) {
|
||||||
|
result = element;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRI_ASSERT(compareTo != nullptr);
|
TRI_ASSERT(compareTo != nullptr);
|
||||||
TRI_ASSERT(compareTo->json() != nullptr);
|
VPackOptions* options = trx->transactionContext()->getVPackOptions();
|
||||||
|
|
||||||
switch (comparisonType) {
|
switch (comparisonType) {
|
||||||
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_EQ:
|
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_EQ:
|
||||||
return TRI_CompareValuesJson(result.json(), compareTo->json(), false) ==
|
return arangodb::basics::VelocyPackHelper::compare(result, compareTo->slice(), false, options) == 0;
|
||||||
0;
|
|
||||||
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_NE:
|
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_NE:
|
||||||
return TRI_CompareValuesJson(result.json(), compareTo->json(), false) !=
|
return arangodb::basics::VelocyPackHelper::compare(result, compareTo->slice(), false, options) != 0;
|
||||||
0;
|
|
||||||
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_LT:
|
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_LT:
|
||||||
return TRI_CompareValuesJson(result.json(), compareTo->json(), true) < 0;
|
return arangodb::basics::VelocyPackHelper::compare(result, compareTo->slice(), true, options) < 0;
|
||||||
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_LE:
|
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_LE:
|
||||||
return TRI_CompareValuesJson(result.json(), compareTo->json(), true) <= 0;
|
return arangodb::basics::VelocyPackHelper::compare(result, compareTo->slice(), true, options) <= 0;
|
||||||
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_GE:
|
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_GE:
|
||||||
return TRI_CompareValuesJson(result.json(), compareTo->json(), true) >= 0;
|
return arangodb::basics::VelocyPackHelper::compare(result, compareTo->slice(), true, options) >= 0;
|
||||||
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_GT:
|
case arangodb::aql::NODE_TYPE_OPERATOR_BINARY_GT:
|
||||||
return TRI_CompareValuesJson(result.json(), compareTo->json(), true) > 0;
|
return arangodb::basics::VelocyPackHelper::compare(result, compareTo->slice(), true, options) > 0;
|
||||||
default:
|
default:
|
||||||
TRI_ASSERT(false);
|
TRI_ASSERT(false);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief evalutes if an element matches the given expression
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
bool TraverserExpression::matchesCheck(TRI_json_t const* element) const {
|
|
||||||
DocumentAccessor accessor(element);
|
|
||||||
return matchesCheck(accessor);
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief evalutes if an element matches the given expression
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
bool TraverserExpression::matchesCheck(VPackSlice const& element) const {
|
|
||||||
DocumentAccessor accessor(element);
|
|
||||||
return matchesCheck(accessor);
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief evalutes if an element matches the given expression
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
bool TraverserExpression::matchesCheck(
|
|
||||||
TRI_doc_mptr_t& element, TRI_document_collection_t* collection,
|
|
||||||
arangodb::CollectionNameResolver const* resolver) const {
|
|
||||||
DocumentAccessor accessor(resolver, collection, &element);
|
|
||||||
return matchesCheck(accessor);
|
|
||||||
}
|
|
||||||
|
|
|
@ -29,11 +29,13 @@
|
||||||
#include "Aql/AstNode.h"
|
#include "Aql/AstNode.h"
|
||||||
#include "Utils/CollectionNameResolver.h"
|
#include "Utils/CollectionNameResolver.h"
|
||||||
#include "Utils/Transaction.h"
|
#include "Utils/Transaction.h"
|
||||||
#include "VocBase/DocumentAccessor.h"
|
|
||||||
#include "VocBase/voc-types.h"
|
#include "VocBase/voc-types.h"
|
||||||
|
|
||||||
namespace arangodb {
|
namespace arangodb {
|
||||||
|
class TransactionContext;
|
||||||
|
|
||||||
namespace velocypack {
|
namespace velocypack {
|
||||||
|
class Builder;
|
||||||
class Slice;
|
class Slice;
|
||||||
}
|
}
|
||||||
namespace traverser {
|
namespace traverser {
|
||||||
|
@ -80,7 +82,7 @@ class TraverserExpression {
|
||||||
bool isEdgeAccess;
|
bool isEdgeAccess;
|
||||||
arangodb::aql::AstNodeType comparisonType;
|
arangodb::aql::AstNodeType comparisonType;
|
||||||
arangodb::aql::AstNode const* varAccess;
|
arangodb::aql::AstNode const* varAccess;
|
||||||
std::unique_ptr<arangodb::basics::Json> compareTo;
|
std::unique_ptr<arangodb::velocypack::Builder> compareTo;
|
||||||
|
|
||||||
TraverserExpression(bool pisEdgeAccess,
|
TraverserExpression(bool pisEdgeAccess,
|
||||||
arangodb::aql::AstNodeType pcomparisonType,
|
arangodb::aql::AstNodeType pcomparisonType,
|
||||||
|
@ -103,15 +105,7 @@ class TraverserExpression {
|
||||||
|
|
||||||
void toJson(arangodb::basics::Json& json, TRI_memory_zone_t* zone) const;
|
void toJson(arangodb::basics::Json& json, TRI_memory_zone_t* zone) const;
|
||||||
|
|
||||||
bool matchesCheck(TRI_doc_mptr_t& element,
|
bool matchesCheck(arangodb::Transaction*, arangodb::velocypack::Slice const& element) const;
|
||||||
TRI_document_collection_t* collection,
|
|
||||||
CollectionNameResolver const* resolver) const;
|
|
||||||
|
|
||||||
bool matchesCheck(TRI_json_t const* element) const;
|
|
||||||
|
|
||||||
bool matchesCheck(arangodb::velocypack::Slice const& element) const;
|
|
||||||
|
|
||||||
bool matchesCheck(DocumentAccessor& accessor) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TraverserExpression()
|
TraverserExpression()
|
||||||
|
@ -121,7 +115,7 @@ class TraverserExpression {
|
||||||
compareTo(nullptr) {}
|
compareTo(nullptr) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool recursiveCheck(arangodb::aql::AstNode const*, DocumentAccessor&) const;
|
bool recursiveCheck(arangodb::aql::AstNode const*, arangodb::velocypack::Slice&) const;
|
||||||
|
|
||||||
// Required when creating this expression without AST
|
// Required when creating this expression without AST
|
||||||
std::vector<std::unique_ptr<arangodb::aql::AstNode const>> _nodeRegister;
|
std::vector<std::unique_ptr<arangodb::aql::AstNode const>> _nodeRegister;
|
||||||
|
|
Loading…
Reference in New Issue