1
0
Fork 0

issue 410.3: remove the extra neting of ArangoSearch view definition into 'properties' (#5956)

* issue 410.3: remove the extra neting of ArangoSearch view definition into 'properties'

* address merge issue

* backport: address test failures

* backport: address dump test failure
This commit is contained in:
Vasiliy 2018-07-24 16:27:28 +03:00 committed by Andrey Abramov
parent f7373fe103
commit fae47715eb
74 changed files with 524 additions and 722 deletions

View File

@ -16,7 +16,7 @@ The result is an object describing the view with the following attributes:
- *id*: The identifier of the view
- *name*: The name of the view
- *type*: The type of the view as string
- any additional view implementation specific propertiesG
- any additional view implementation specific properties
@RESTRETURNCODES

View File

@ -128,10 +128,10 @@ The default locale used for queries on analyzed string values (default: *C*).
Changes the properties of a view.
On success an object with the following attributes is returned:
- *id*: The identifier of the view.
- *name*: The name of the view.
- *type*: The view type.
- *properties*: The updated properties of the view.
- *id*: The identifier of the view
- *name*: The name of the view
- *type*: The view type
- all additional arangosearch view implementation specific properties
@RESTRETURNCODES

View File

@ -106,8 +106,7 @@ If the *view-name* is unknown, then a *HTTP 404* is returned.
var url = "/_api/view";
var body = {
name: "testViewBasics",
type: "arangosearch",
properties: {}
type: "arangosearch"
};
var response = logCurlRequest('POST', url, body);

View File

@ -126,10 +126,10 @@ The default locale used for queries on analyzed string values (default: *C*).
Changes the properties of a view.
On success an object with the following attributes is returned:
- *id*: The identifier of the view.
- *name*: The name of the view.
- *type*: The view type.
- *properties*: The updated properties of the view.
- *id*: The identifier of the view
- *name*: The name of the view
- *type*: The view type
- all additional arangosearch view implementation specific properties
@RESTRETURNCODES

View File

@ -373,7 +373,7 @@ describe ArangoDB do
cmd2 = api + '/lemon/properties'
body2 = <<-JSON
{ "properties": { "bogus": "junk", "commit": { "commitIntervalMsec": 17 } } }
{ "bogus": "junk", "commit": { "commitIntervalMsec": 17 } }
JSON
doc2 = ArangoDB.log_put("#{prefix}-modify-unacceptable", cmd2, :body => body2)
doc2.code.should eq(200)
@ -384,7 +384,7 @@ describe ArangoDB do
cmd3 = api + '/lemon/properties'
doc4 = ArangoDB.log_get("#{prefix}-modify-unacceptable", cmd3)
doc4.parsed_response['properties']['commit']['commitIntervalMsec'].should eq(17)
doc4.parsed_response['commit']['commitIntervalMsec'].should eq(17)
cmd4 = api + '/lemon'
doc4 = ArangoDB.log_delete("#{prefix}-modify-unacceptable", cmd4)
@ -445,7 +445,7 @@ describe ArangoDB do
body1 = <<-JSON
{ "name": "abc",
"type": "arangosearch",
"properties": { "commit": { "commitIntervalMsec": 10 } }
"commit": { "commitIntervalMsec": 10 }
}
JSON
doc1 = ArangoDB.log_post("#{prefix}-short-list", cmd1, :body => body1)
@ -458,7 +458,7 @@ describe ArangoDB do
body2 = <<-JSON
{ "name": "def",
"type": "arangosearch",
"properties": { "commit": { "commitIntervalMsec": 10 } }
"commit": { "commitIntervalMsec": 10 }
}
JSON
doc2 = ArangoDB.log_post("#{prefix}-short-list", cmd2, :body => body2)
@ -490,7 +490,7 @@ describe ArangoDB do
doc2 = ArangoDB.log_get("#{prefix}-individual-views", cmd2)
doc2.code.should eq(200)
doc2.headers['content-type'].should eq("application/json; charset=utf-8")
doc2.parsed_response['properties']['commit']['commitIntervalMsec'].should eq(10)
doc2.parsed_response['commit']['commitIntervalMsec'].should eq(10)
cmd3 = api + '/def'
doc3 = ArangoDB.log_get("#{prefix}-individual-views", cmd3)
@ -503,7 +503,7 @@ describe ArangoDB do
doc4 = ArangoDB.log_get("#{prefix}-individual-views", cmd4)
doc4.code.should eq(200)
doc4.headers['content-type'].should eq("application/json; charset=utf-8")
doc4.parsed_response['properties']['commit']['commitIntervalMsec'].should eq(10)
doc4.parsed_response['commit']['commitIntervalMsec'].should eq(10)
end
end
@ -513,60 +513,60 @@ describe ArangoDB do
it "change properties" do
cmd1 = api + '/abc/properties'
body1 = <<-JSON
{ "properties": { "commit": { "commitIntervalMsec": 7 } } }
{ "commit": { "commitIntervalMsec": 7 } }
JSON
doc1 = ArangoDB.log_put("#{prefix}-change-properties", cmd1, :body => body1)
doc1.code.should eq(200)
doc1.headers['content-type'].should eq("application/json; charset=utf-8")
doc1.parsed_response['name'].should eq('abc')
doc1.parsed_response['type'].should eq('arangosearch')
doc1.parsed_response['properties'].should be_kind_of(Hash)
doc1.parsed_response['commit'].should be_kind_of(Hash)
cmd2 = api + '/abc/properties'
doc2 = ArangoDB.log_get("#{prefix}-change-properties", cmd2)
doc2.code.should eq(200)
doc2.headers['content-type'].should eq("application/json; charset=utf-8")
doc2.parsed_response['properties']['commit']['commitIntervalMsec'].should eq(7)
doc2.parsed_response['commit']['commitIntervalMsec'].should eq(7)
end
it "ignore extra properties" do
cmd1 = api + '/abc/properties'
body1 = <<-JSON
{ "properties": { "commit": { "commitIntervalMsec": 10 }, "extra": "foobar" } }
{ "commit": { "commitIntervalMsec": 10 }, "extra": "foobar" }
JSON
doc1 = ArangoDB.log_put("#{prefix}-ignore-extra-properties", cmd1, :body => body1)
doc1.code.should eq(200)
doc1.headers['content-type'].should eq("application/json; charset=utf-8")
doc1.parsed_response['name'].should eq('abc')
doc1.parsed_response['type'].should eq('arangosearch')
doc1.parsed_response['properties'].should be_kind_of(Hash)
doc1.parsed_response['commit'].should be_kind_of(Hash)
doc1.parsed_response['extra'].should eq(nil)
cmd2 = api + '/abc/properties'
doc2 = ArangoDB.log_get("#{prefix}-ignore-extra-properties", cmd2)
doc2.code.should eq(200)
doc2.headers['content-type'].should eq("application/json; charset=utf-8")
doc2.parsed_response['properties']['commit']['commitIntervalMsec'].should eq(10)
doc2.parsed_response['commit']['commitIntervalMsec'].should eq(10)
doc2.parsed_response['extra'].should eq(nil)
end
it "accept updates via PATCH as well" do
cmd1 = api + '/abc/properties'
body1 = <<-JSON
{ "properties": { "commit": { "commitIntervalMsec": 3 } } }
{ "commit": { "commitIntervalMsec": 3 } }
JSON
doc1 = ArangoDB.log_patch("#{prefix}-accept-patch", cmd1, :body => body1)
doc1.code.should eq(200)
doc1.headers['content-type'].should eq("application/json; charset=utf-8")
doc1.parsed_response['name'].should eq('abc')
doc1.parsed_response['type'].should eq('arangosearch')
doc1.parsed_response['properties'].should be_kind_of(Hash)
doc1.parsed_response['commit'].should be_kind_of(Hash)
cmd2 = api + '/abc/properties'
doc2 = ArangoDB.log_get("#{prefix}-accept-patch", cmd2)
doc2.code.should eq(200)
doc2.headers['content-type'].should eq("application/json; charset=utf-8")
doc2.parsed_response['properties']['commit']['commitIntervalMsec'].should eq(3)
doc2.parsed_response['commit']['commitIntervalMsec'].should eq(3)
end
end

View File

@ -52,7 +52,6 @@ arangodb::LogTopic& logTopic() {
// -----------------------------------------------------------------------------
std::string const StaticStrings::LinksField("links");
std::string const StaticStrings::PropertiesField("properties");
std::string const StaticStrings::ViewIdField("view");
} // iresearch

View File

@ -43,12 +43,6 @@ struct StaticStrings {
////////////////////////////////////////////////////////////////////////////////
static std::string const LinksField;
////////////////////////////////////////////////////////////////////////////////
/// @brief the name of the field in the IResearch View definition denoting the
/// corresponding properties definitions
////////////////////////////////////////////////////////////////////////////////
static std::string const PropertiesField;
////////////////////////////////////////////////////////////////////////////////
/// @brief the id of the field in the IResearch Link definition denoting the
/// corresponding IResearch View

View File

@ -923,13 +923,6 @@ arangodb::Result IResearchView::appendVelocyPackDetailed(
return arangodb::Result(TRI_ERROR_BAD_PARAMETER);
}
builder.add(
StaticStrings::PropertiesField,
arangodb::velocypack::Value(arangodb::velocypack::ValueType::Object)
);
auto closePropertiesField = // close StaticStrings::PropertiesField
irs::make_finally([&builder]()->void { builder.close(); });
std::vector<std::string> collections;
{
@ -1501,9 +1494,7 @@ int IResearchView::insert(
new IResearchView(vocbase, info, *feature, planVersion)
);
auto& impl = reinterpret_cast<IResearchView&>(*view);
auto& json = info.isObject() ? info : emptyObjectSlice(); // if no 'info' then assume defaults
auto props = json.get(StaticStrings::PropertiesField);
auto& properties = props.isObject() ? props : emptyObjectSlice(); // if no 'info' then assume defaults
auto& properties = info.isObject() ? info : emptyObjectSlice(); // if no 'info' then assume defaults
std::string error;
if (!impl._meta->init(properties, error)
@ -1844,11 +1835,6 @@ arangodb::Result IResearchView::updateProperties(
arangodb::velocypack::Slice const& slice,
bool partialUpdate
) {
if (slice.isObject() && !slice.hasKey(StaticStrings::PropertiesField)) {
return arangodb::Result(); // nothing to update
}
auto properties = slice.get(StaticStrings::PropertiesField);
std::string error;
IResearchViewMeta meta;
WriteMutex mutex(_mutex); // '_metaState' can be asynchronously read
@ -1861,7 +1847,7 @@ arangodb::Result IResearchView::updateProperties(
IResearchViewMeta* metaPtr = viewMeta.get();
auto& initialMeta = partialUpdate ? *metaPtr : IResearchViewMeta::DEFAULT();
if (!meta.init(properties, error, initialMeta)) {
if (!meta.init(slice, error, initialMeta)) {
return arangodb::Result(TRI_ERROR_BAD_PARAMETER, std::move(error));
}
@ -1875,7 +1861,8 @@ arangodb::Result IResearchView::updateProperties(
mutex.unlock(true); // downgrade to a read-lock
if (!properties.hasKey(StaticStrings::LinksField)) {
if (!slice.hasKey(StaticStrings::LinksField)
&& (partialUpdate || _inRecovery.load())) { // ignore missing links coming from WAL (inRecovery)
return res;
}
@ -1886,7 +1873,9 @@ arangodb::Result IResearchView::updateProperties(
// ...........................................................................
std::unordered_set<TRI_voc_cid_t> collections;
auto links = properties.get(StaticStrings::LinksField);
auto links = slice.hasKey(StaticStrings::LinksField)
? slice.get(StaticStrings::LinksField)
: arangodb::velocypack::Slice::emptyObjectSlice(); // used for !partialUpdate
if (partialUpdate) {
mtx.unlock(); // release lock
@ -2034,4 +2023,4 @@ NS_END // arangodb
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -268,14 +268,6 @@ arangodb::Result IResearchViewCoordinator::appendVelocyPackDetailed(
);
}
builder.add(
StaticStrings::PropertiesField,
arangodb::velocypack::Value(arangodb::velocypack::ValueType::Object)
);
auto closePropertiesField = // close StaticStrings::PropertiesField
irs::make_finally([&builder]()->void { builder.close(); });
if (!_meta.json(builder)) {
return arangodb::Result(
TRI_ERROR_INTERNAL,
@ -349,9 +341,7 @@ bool IResearchViewCoordinator::emplace(
auto view = std::shared_ptr<IResearchViewCoordinator>(
new IResearchViewCoordinator(vocbase, info, planVersion)
);
auto& json = info.isObject() ? info : emptyObjectSlice(); // if no 'info' then assume defaults
auto props = json.get(StaticStrings::PropertiesField);
auto& properties = props.isObject() ? props : emptyObjectSlice(); // if no 'props' then assume defaults
auto& properties = info.isObject() ? info : emptyObjectSlice(); // if no 'info' then assume defaults
std::string error;
if (!view->_meta.init(properties, error)) {
@ -435,12 +425,6 @@ arangodb::Result IResearchViewCoordinator::updateProperties(
bool partialUpdate,
bool /*doSync*/
) {
if (slice.isObject() && !slice.hasKey(StaticStrings::PropertiesField)) {
return arangodb::Result(); // nothing to update
}
auto properties = slice.get(StaticStrings::PropertiesField);
try {
IResearchViewMeta meta;
std::string error;
@ -449,7 +433,7 @@ arangodb::Result IResearchViewCoordinator::updateProperties(
? _meta
: IResearchViewMeta::DEFAULT();
if (!meta.init(properties, error, defaults)) {
if (!meta.init(slice, error, defaults)) {
return { TRI_ERROR_BAD_PARAMETER, error };
}
@ -467,12 +451,7 @@ arangodb::Result IResearchViewCoordinator::updateProperties(
arangodb::velocypack::Builder builder;
builder.openObject();
builder.add(
StaticStrings::PropertiesField,
arangodb::velocypack::Value(arangodb::velocypack::ValueType::Object)
);
meta.json(builder);
builder.close(); // close PROPERTIES_FIELD
meta.json(builder);
auto result = toVelocyPack(builder, false, true);
@ -490,7 +469,7 @@ arangodb::Result IResearchViewCoordinator::updateProperties(
}
}
if (!properties.hasKey(StaticStrings::LinksField)) {
if (!slice.hasKey(StaticStrings::LinksField) && partialUpdate) {
return arangodb::Result(); // nothing more to do
}
@ -520,11 +499,15 @@ arangodb::Result IResearchViewCoordinator::updateProperties(
arangodb::velocypack::Builder viewNewProperties;
bool modified = false;
std::unordered_set<TRI_voc_cid_t> newCids;
auto links = slice.hasKey(StaticStrings::LinksField)
? slice.get(StaticStrings::LinksField)
: arangodb::velocypack::Slice::emptyObjectSlice(); // used for !partialUpdate
viewNewProperties.openObject();
return updateLinks(
properties.get(StaticStrings::LinksField),
links,
currentLinks.slice(),
*this,
partialUpdate,

View File

@ -208,14 +208,6 @@ arangodb::Result IResearchViewDBServer::appendVelocyPackDetailed(
);
}
builder.add(
StaticStrings::PropertiesField,
arangodb::velocypack::Value(arangodb::velocypack::ValueType::Object)
);
auto closePropertiesField = // close StaticStrings::PropertiesField
irs::make_finally([&builder]()->void { builder.close(); });
{
SCOPED_LOCK(_meta->read()); // '_meta' can be asynchronously updated
@ -326,24 +318,15 @@ std::shared_ptr<arangodb::LogicalView> IResearchViewDBServer::ensure(
); // type required for proper factory selection
{
builder.add(
StaticStrings::PropertiesField,
arangodb::velocypack::Value(arangodb::velocypack::ValueType::Object)
);
SCOPED_LOCK(_meta->read()); // '_meta' can be asynchronously updated
{
SCOPED_LOCK(_meta->read()); // '_meta' can be asynchronously updated
if (!_meta->json(builder)) {
builder.close(); // close StaticStrings::PropertiesField
LOG_TOPIC(WARN, arangodb::iresearch::TOPIC)
<< "failure to generate properties definition while constructing IResearch View in database '" << vocbase().name() << "'";
if (!_meta->json(builder)) {
builder.close(); // close StaticStrings::PropertiesField
LOG_TOPIC(WARN, arangodb::iresearch::TOPIC)
<< "failure to generate properties definition while constructing IResearch View in database '" << vocbase().name() << "'";
return nullptr;
}
return nullptr;
}
builder.close(); // close StaticStrings::PropertiesField
}
builder.close();
@ -432,9 +415,7 @@ std::shared_ptr<arangodb::LogicalView> IResearchViewDBServer::ensure(
new IResearchViewDBServer(vocbase, info, *feature, planVersion)
);
auto& json = info.isObject() ? info : emptyObjectSlice(); // if no 'info' then assume defaults
auto props = json.get(StaticStrings::PropertiesField);
auto& properties = props.isObject() ? props : emptyObjectSlice(); // if no 'info' then assume defaults
auto& properties = info.isObject() ? info : emptyObjectSlice(); // if no 'info' then assume defaults
std::string error;
IResearchViewMeta meta;
@ -649,13 +630,7 @@ arangodb::Result IResearchViewDBServer::updateProperties(
bool partialUpdate,
bool doSync
) {
if (slice.isObject() && !slice.hasKey(StaticStrings::PropertiesField)) {
return arangodb::Result(); // nothing to update
}
auto properties = slice.get(StaticStrings::PropertiesField);
if (!properties.isObject()) {
if (!slice.isObject()) {
return arangodb::Result(
TRI_ERROR_BAD_PARAMETER,
std::string("invalid properties supplied while updating IResearch View in database '") + vocbase().name() + "'"
@ -675,7 +650,7 @@ arangodb::Result IResearchViewDBServer::updateProperties(
props.openObject();
if (!mergeSliceSkipKeys(props, properties, propsAcceptor)) {
if (!mergeSliceSkipKeys(props, slice, propsAcceptor)) {
return arangodb::Result(
TRI_ERROR_INTERNAL,
std::string("failure to generate definition while updating IResearch View in database '") + vocbase().name() + "'"
@ -720,7 +695,7 @@ arangodb::Result IResearchViewDBServer::updateProperties(
feature->asyncNotify();
}
if (!properties.hasKey(StaticStrings::LinksField)) {
if (!slice.hasKey(StaticStrings::LinksField) && partialUpdate) {
return arangodb::Result();
}
@ -729,7 +704,10 @@ arangodb::Result IResearchViewDBServer::updateProperties(
// ...........................................................................
std::unordered_set<TRI_voc_cid_t> collections;
auto links = properties.get(StaticStrings::LinksField);
auto links = slice.hasKey(StaticStrings::LinksField)
? slice.get(StaticStrings::LinksField)
: arangodb::velocypack::Slice::emptyObjectSlice(); // used for !partialUpdate
if (partialUpdate) {
return IResearchLinkHelper::updateLinks(

View File

@ -56,7 +56,7 @@ function IResearchAqlTestSuite(numberOfShards, replicationFactor) {
db._dropView("UnitTestsView");
v = db._createView("UnitTestsView", "arangosearch", {});
var meta = { properties: {
var meta = {
links: {
"UnitTestsCollection": {
includeAllFields: true,
@ -65,7 +65,7 @@ function IResearchAqlTestSuite(numberOfShards, replicationFactor) {
}
}
}
} };
};
v.properties(meta);
ac.save({ a: "foo", id : 0 });
@ -90,7 +90,7 @@ function IResearchAqlTestSuite(numberOfShards, replicationFactor) {
},
tearDown : function () {
var meta = { properties: { links : { "UnitTestsCollection": null } } };
var meta = { links : { "UnitTestsCollection": null } };
v.properties(meta);
v.drop();
db._drop("UnitTestsCollection");

View File

@ -62,12 +62,12 @@ function IResearchFeatureDDLTestSuite () {
db._dropView("TestView");
db._create("TestCollection0");
var addLink = { properties: { links: { "TestCollection0": {} } } };
var addLink = { links: { "TestCollection0": {} } };
for (let i = 0; i < 100; ++i) {
var view = db._createView("TestView", "arangosearch", {});
view.properties(addLink, true); // partial update
let properties = view.properties().properties;
let properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(1, Object.keys(properties.links).length);
var indexes = db.TestCollection0.getIndexes();
@ -88,12 +88,12 @@ function IResearchFeatureDDLTestSuite () {
db._create("TestCollection0");
var view = db._createView("TestView", "arangosearch", {});
var addLink = { properties: { links: { "TestCollection0": {} } } };
var removeLink = { properties: { links: { "TestCollection0": null } } };
var addLink = { links: { "TestCollection0": {} } };
var removeLink = { links: { "TestCollection0": null } };
for (let i = 0; i < 100; ++i) {
view.properties(addLink, true); // partial update
let properties = view.properties().properties;
let properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(1, Object.keys(properties.links).length);
var indexes = db.TestCollection0.getIndexes();
@ -103,7 +103,7 @@ function IResearchFeatureDDLTestSuite () {
assertNotEqual(null, link);
assertEqual("arangosearch", link.type);
view.properties(removeLink, false);
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(0, Object.keys(properties.links).length);
assertEqual(1, db.TestCollection0.getIndexes().length);
@ -116,13 +116,13 @@ function IResearchFeatureDDLTestSuite () {
var view = db._createView("TestView", "arangosearch", {});
db._create("TestCollection0");
var addLink = { properties: { links: { "TestCollection0": {} } } };
var addLink = { links: { "TestCollection0": {} } };
view.properties(addLink, true); // partial update
let properties = view.properties().properties;
let properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(1, Object.keys(properties.links).length);
db._drop("TestCollection0");
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(0, Object.keys(properties.links).length);
},
@ -138,25 +138,25 @@ function IResearchFeatureDDLTestSuite () {
db._create("TestCollection2");
var view = db._createView("TestView", "arangosearch", {});
var properties = view.properties().properties;
var properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(0, Object.keys(properties.links).length);
var meta = { properties: { links: { "TestCollection0": {} } } };
var meta = { links: { "TestCollection0": {} } };
view.properties(meta, true); // partial update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(1, Object.keys(properties.links).length);
meta = { properties: { links: { "TestCollection1": {} } } };
meta = { links: { "TestCollection1": {} } };
view.properties(meta, true); // partial update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(2, Object.keys(properties.links).length);
meta = { properties: { links: { "TestCollection2": {} } } };
meta = { links: { "TestCollection2": {} } };
view.properties(meta, false); // full update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(1, Object.keys(properties.links).length);
@ -165,7 +165,7 @@ function IResearchFeatureDDLTestSuite () {
db._dropView("TestView");
view = db._createView("TestView", "arangosearch", {});
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.commit.constructor);
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(60000, properties.commit.commitIntervalMsec);
@ -184,16 +184,16 @@ function IResearchFeatureDDLTestSuite () {
assertEqual(300, properties.commit.consolidate.fill.segmentThreshold);
assertEqual((0.85).toFixed(6), properties.commit.consolidate.fill.threshold.toFixed(6));
meta = { properties: { commit: {
meta = { commit: {
commitIntervalMsec: 10000,
consolidate: {
bytes: { segmentThreshold: 20, threshold: 0.5 },
bytes_accum: {},
count: {}
}
} } };
} };
view.properties(meta, true); // partial update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.commit.constructor);
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(10000, properties.commit.commitIntervalMsec);
@ -209,12 +209,12 @@ function IResearchFeatureDDLTestSuite () {
assertEqual(300, properties.commit.consolidate.count.segmentThreshold);
assertEqual((0.85).toFixed(6), properties.commit.consolidate.count.threshold.toFixed(6));
meta = { properties: { commit: {
meta = { commit: {
cleanupIntervalStep: 20,
consolidate: { count: { segmentThreshold: 30, threshold: 0.75 } }
} } };
} };
view.properties(meta, false); // full update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.commit.constructor);
assertEqual(20, properties.commit.cleanupIntervalStep);
assertEqual(60000, properties.commit.commitIntervalMsec);
@ -229,10 +229,10 @@ function IResearchFeatureDDLTestSuite () {
db._dropView("TestView");
view = db._createView("TestView", "arangosearch", {});
properties = view.properties().properties;
meta = { properties: { locale: "de_DE.UTF-16" } };
properties = view.properties();
meta = { locale: "de_DE.UTF-16" };
view.properties(meta);
properties = view.properties().properties;
properties = view.properties();
assertTrue(String === properties.locale.constructor);
assertTrue(properties.locale.length > 0);
assertEqual("de_DE.UTF-8", properties.locale);
@ -248,7 +248,7 @@ function IResearchFeatureDDLTestSuite () {
db._create("TestCollection2");
var view = db._createView("TestView", "arangosearch", {});
var meta = { properties: { links: {
var meta = { links: {
"TestCollection0": {},
"TestCollection1": { analyzers: [ "text_en"], includeAllFields: true, trackListPositions: true, trackValues: "full" },
"TestCollection2": { fields: {
@ -257,9 +257,9 @@ function IResearchFeatureDDLTestSuite () {
"d": { trackListPositions: true, trackValues: "exists" },
"e": { analyzers: [ "text_de"] }
} }
} } };
} };
view.properties(meta, true); // partial update
var properties = view.properties().properties;
var properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(3, Object.keys(properties.links).length);
@ -325,9 +325,9 @@ function IResearchFeatureDDLTestSuite () {
assertTrue(String === properties.links.TestCollection2.analyzers[0].constructor);
assertEqual("identity", properties.links.TestCollection2.analyzers[0]);
meta = { properties: { links: { "TestCollection0": null, "TestCollection2": {} } } };
meta = { links: { "TestCollection0": null, "TestCollection2": {} } };
view.properties(meta, true); // partial update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(2, Object.keys(properties.links).length);
@ -360,9 +360,9 @@ function IResearchFeatureDDLTestSuite () {
assertTrue(String === properties.links.TestCollection2.analyzers[0].constructor);
assertEqual("identity", properties.links.TestCollection2.analyzers[0]);
meta = { properties: { links: { "TestCollection0": { includeAllFields: true }, "TestCollection1": {} } } };
meta = { links: { "TestCollection0": { includeAllFields: true }, "TestCollection1": {} } };
view.properties(meta, false); // full update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(2, Object.keys(properties.links).length);
@ -403,7 +403,7 @@ function IResearchFeatureDDLTestSuite () {
var col0 = db._create("TestCollection0");
var view = db._createView("TestView", "arangosearch", {});
var meta = { properties: { links: { "TestCollection0": { includeAllFields: true } } } };
var meta = { links: { "TestCollection0": { includeAllFields: true } } };
view.properties(meta, true); // partial update
var result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -425,7 +425,7 @@ function IResearchFeatureDDLTestSuite () {
col0.save({ name: "other half", text: "the brown jumps the dog" });
col0.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: { "TestCollection0": { includeAllFields: true } } } };
meta = { links: { "TestCollection0": { includeAllFields: true } } };
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -448,10 +448,10 @@ function IResearchFeatureDDLTestSuite () {
col1.save({ name: "other half", text: "the brown jumps the dog" });
col1.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: {
meta = { links: {
"TestCollection0": { includeAllFields: true },
"TestCollection1": { includeAllFields: true }
} } };
} };
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -476,11 +476,11 @@ function IResearchFeatureDDLTestSuite () {
col0.save({ name: "other half", text: "the brown jumps the dog" });
col0.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: {
meta = { links: {
"TestCollection0": { includeAllFields: true },
"TestCollection1": { includeAllFields: true },
"TestCollection2": { includeAllFields: true }
} } };
} };
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -498,10 +498,10 @@ function IResearchFeatureDDLTestSuite () {
var col0 = db._create("TestCollection0");
var view = db._createView("TestView", "arangosearch", {});
var meta = { properties: { links: { "TestCollection0": { includeAllFields: true } } } };
var meta = { links: { "TestCollection0": { includeAllFields: true } } };
view.properties(meta, true); // partial update
meta = { properties: {
meta = {
commit: {
commitIntervalMsec: 10000,
consolidate: {
@ -511,12 +511,12 @@ function IResearchFeatureDDLTestSuite () {
}
},
locale: "de_DE.UTF-16"
} };
};
view.properties(meta, true); // partial update
var result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
assertEqual(0, result.length);
var properties = view.properties().properties;
var properties = view.properties();
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(10000, properties.commit.commitIntervalMsec);
assertEqual(3, Object.keys(properties.commit.consolidate).length);
@ -544,10 +544,10 @@ function IResearchFeatureDDLTestSuite () {
col0.save({ name: "other half", text: "the brown jumps the dog" });
col0.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: { "TestCollection0": { includeAllFields: true } } } };
meta = { links: { "TestCollection0": { includeAllFields: true } } };
view.properties(meta, true); // partial update
meta = { properties: {
meta = {
commit: {
commitIntervalMsec: 10000,
consolidate: {
@ -557,7 +557,7 @@ function IResearchFeatureDDLTestSuite () {
}
},
locale: "de_DE.UTF-16"
} };
};
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -566,7 +566,7 @@ function IResearchFeatureDDLTestSuite () {
assertEqual("half", result[1].name);
assertEqual("other half", result[2].name);
assertEqual("quarter", result[3].name);
properties = view.properties().properties;
properties = view.properties();
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(10000, properties.commit.commitIntervalMsec);
assertEqual(3, Object.keys(properties.commit.consolidate).length);
@ -591,13 +591,13 @@ function IResearchFeatureDDLTestSuite () {
col1.save({ name: "other half", text: "the brown jumps the dog" });
col1.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: {
meta = { links: {
"TestCollection0": { includeAllFields: true },
"TestCollection1": { includeAllFields: true }
} } };
} };
view.properties(meta, true); // partial update
meta = { properties: {
meta = {
commit: {
commitIntervalMsec: 10000,
consolidate: {
@ -607,7 +607,7 @@ function IResearchFeatureDDLTestSuite () {
}
},
locale: "de_DE.UTF-16"
} };
};
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -616,7 +616,7 @@ function IResearchFeatureDDLTestSuite () {
assertEqual("half", result[1].name);
assertEqual("other half", result[2].name);
assertEqual("quarter", result[3].name);
properties = view.properties().properties;
properties = view.properties();
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(10000, properties.commit.commitIntervalMsec);
assertEqual(3, Object.keys(properties.commit.consolidate).length);
@ -643,14 +643,14 @@ function IResearchFeatureDDLTestSuite () {
col0.save({ name: "other half", text: "the brown jumps the dog" });
col0.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: {
meta = { links: {
"TestCollection0": { includeAllFields: true },
"TestCollection1": { includeAllFields: true },
"TestCollection2": { includeAllFields: true }
} } };
} };
view.properties(meta, true); // partial update
meta = { properties: {
meta = {
commit: {
commitIntervalMsec: 10000,
consolidate: {
@ -660,7 +660,7 @@ function IResearchFeatureDDLTestSuite () {
}
},
locale: "de_DE.UTF-16"
} };
};
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -669,7 +669,7 @@ function IResearchFeatureDDLTestSuite () {
assertEqual("half", result[1].name);
assertEqual("other half", result[2].name);
assertEqual("quarter", result[3].name);
properties = view.properties().properties;
properties = view.properties();
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(10000, properties.commit.commitIntervalMsec);
assertEqual(3, Object.keys(properties.commit.consolidate).length);
@ -693,7 +693,7 @@ function IResearchFeatureDDLTestSuite () {
col0.save({ b: "bar", c: "foo", z: 2 });
col0.save({ b: "baz", d: "foz", z: 3 });
var meta = { properties: { links: { "TestCollection0": { fields: { a: {} } } } } };
var meta = { links: { "TestCollection0": { fields: { a: {} } } } };
view.properties(meta, true); // partial update
var result = db._query("FOR doc IN VIEW TestView SORT doc.z RETURN doc", null, { waitForSync: true }).toArray();
@ -701,10 +701,10 @@ function IResearchFeatureDDLTestSuite () {
assertEqual(0, result[0].z);
assertEqual(1, result[1].z);
meta = { properties: { links: { "TestCollection0": { fields: { b: {} } } } } };
meta = { links: { "TestCollection0": { fields: { b: {} } } } };
view.properties(meta, true); // partial update
var updatedMeta = view.properties().properties;
var updatedMeta = view.properties();
assertNotEqual(undefined, updatedMeta.links.TestCollection0.fields.b);
assertEqual(undefined, updatedMeta.links.TestCollection0.fields.a);
@ -713,7 +713,7 @@ function IResearchFeatureDDLTestSuite () {
assertEqual(2, result[0].z);
assertEqual(3, result[1].z);
meta = { properties: { links: { "TestCollection0": { fields: { c: {} } } } } };
meta = { links: { "TestCollection0": { fields: { c: {} } } } };
view.properties(meta, false); // full update
result = db._query("FOR doc IN VIEW TestView SORT doc.z RETURN doc", null, { waitForSync: true }).toArray();

View File

@ -58,25 +58,25 @@ function iResearchFeatureAqlTestSuite () {
db._create("TestCollection2");
var view = db._createView("TestView", "arangosearch", {});
var properties = view.properties().properties;
var properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(0, Object.keys(properties.links).length);
var meta = { properties: { links: { "TestCollection0": {} } } };
var meta = { links: { "TestCollection0": {} } };
view.properties(meta, true); // partial update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(1, Object.keys(properties.links).length);
meta = { properties: { links: { "TestCollection1": {} } } };
meta = { links: { "TestCollection1": {} } };
view.properties(meta, true); // partial update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(2, Object.keys(properties.links).length);
meta = { properties: { links: { "TestCollection2": {} } } };
meta = { links: { "TestCollection2": {} } };
view.properties(meta, false); // full update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(1, Object.keys(properties.links).length);
@ -85,7 +85,7 @@ function iResearchFeatureAqlTestSuite () {
db._dropView("TestView");
view = db._createView("TestView", "arangosearch", {});
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.commit.constructor);
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(60000, properties.commit.commitIntervalMsec);
@ -104,16 +104,16 @@ function iResearchFeatureAqlTestSuite () {
assertEqual(300, properties.commit.consolidate.fill.segmentThreshold);
assertEqual((0.85).toFixed(6), properties.commit.consolidate.fill.threshold.toFixed(6));
meta = { properties: { commit: {
meta = { commit: {
commitIntervalMsec: 10000,
consolidate: {
bytes: { segmentThreshold: 20, threshold: 0.5 },
bytes_accum: {},
count: {}
}
} } };
} };
view.properties(meta, true); // partial update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.commit.constructor);
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(10000, properties.commit.commitIntervalMsec);
@ -129,12 +129,12 @@ function iResearchFeatureAqlTestSuite () {
assertEqual(300, properties.commit.consolidate.count.segmentThreshold);
assertEqual((0.85).toFixed(6), properties.commit.consolidate.count.threshold.toFixed(6));
meta = { properties: { commit: {
meta = { commit: {
cleanupIntervalStep: 20,
consolidate: { count: { segmentThreshold: 30, threshold: 0.75 } }
} } };
} };
view.properties(meta, false); // full update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.commit.constructor);
assertEqual(20, properties.commit.cleanupIntervalStep);
assertEqual(60000, properties.commit.commitIntervalMsec);
@ -149,10 +149,10 @@ function iResearchFeatureAqlTestSuite () {
db._dropView("TestView");
view = db._createView("TestView", "arangosearch", {});
properties = view.properties().properties;
meta = { properties: { locale: "de_DE.UTF-16" } };
properties = view.properties();
meta = { locale: "de_DE.UTF-16" };
view.properties(meta);
properties = view.properties().properties;
properties = view.properties();
assertTrue(String === properties.locale.constructor);
assertTrue(properties.locale.length > 0);
assertEqual("de_DE.UTF-8", properties.locale);
@ -168,7 +168,7 @@ function iResearchFeatureAqlTestSuite () {
db._create("TestCollection2");
var view = db._createView("TestView", "arangosearch", {});
var meta = { properties: { links: {
var meta = { links: {
"TestCollection0": {},
"TestCollection1": { analyzers: [ "text_en"], includeAllFields: true, trackListPositions: true, trackValues: "full" },
"TestCollection2": { fields: {
@ -177,9 +177,9 @@ function iResearchFeatureAqlTestSuite () {
"d": { trackListPositions: true, trackValues: "exists" },
"e": { analyzers: [ "text_de"] }
} }
} } };
} };
view.properties(meta, true); // partial update
var properties = view.properties().properties;
var properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(3, Object.keys(properties.links).length);
@ -245,9 +245,9 @@ function iResearchFeatureAqlTestSuite () {
assertTrue(String === properties.links.TestCollection2.analyzers[0].constructor);
assertEqual("identity", properties.links.TestCollection2.analyzers[0]);
meta = { properties: { links: { "TestCollection0": null, "TestCollection2": {} } } };
meta = { links: { "TestCollection0": null, "TestCollection2": {} } };
view.properties(meta, true); // partial update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(2, Object.keys(properties.links).length);
@ -280,9 +280,9 @@ function iResearchFeatureAqlTestSuite () {
assertTrue(String === properties.links.TestCollection2.analyzers[0].constructor);
assertEqual("identity", properties.links.TestCollection2.analyzers[0]);
meta = { properties: { links: { "TestCollection0": { includeAllFields: true }, "TestCollection1": {} } } };
meta = { links: { "TestCollection0": { includeAllFields: true }, "TestCollection1": {} } };
view.properties(meta, false); // full update
properties = view.properties().properties;
properties = view.properties();
assertTrue(Object === properties.links.constructor);
assertEqual(2, Object.keys(properties.links).length);
@ -323,7 +323,7 @@ function iResearchFeatureAqlTestSuite () {
var col0 = db._create("TestCollection0");
var view = db._createView("TestView", "arangosearch", {});
var meta = { properties: { links: { "TestCollection0": { includeAllFields: true } } } };
var meta = { links: { "TestCollection0": { includeAllFields: true } } };
view.properties(meta, true); // partial update
var result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -345,7 +345,7 @@ function iResearchFeatureAqlTestSuite () {
col0.save({ name: "other half", text: "the brown jumps the dog" });
col0.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: { "TestCollection0": { includeAllFields: true } } } };
meta = { links: { "TestCollection0": { includeAllFields: true } } };
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -368,10 +368,10 @@ function iResearchFeatureAqlTestSuite () {
col1.save({ name: "other half", text: "the brown jumps the dog" });
col1.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: {
meta = { links: {
"TestCollection0": { includeAllFields: true },
"TestCollection1": { includeAllFields: true }
} } };
} };
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -396,11 +396,11 @@ function iResearchFeatureAqlTestSuite () {
col0.save({ name: "other half", text: "the brown jumps the dog" });
col0.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: {
meta = { links: {
"TestCollection0": { includeAllFields: true },
"TestCollection1": { includeAllFields: true },
"TestCollection2": { includeAllFields: true }
} } };
} };
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -418,10 +418,10 @@ function iResearchFeatureAqlTestSuite () {
var col0 = db._create("TestCollection0");
var view = db._createView("TestView", "arangosearch", {});
var meta = { properties: { links: { "TestCollection0": { includeAllFields: true } } } };
var meta = { links: { "TestCollection0": { includeAllFields: true } } };
view.properties(meta, true); // partial update
meta = { properties: {
meta = {
commit: {
commitIntervalMsec: 10000,
consolidate: {
@ -431,12 +431,12 @@ function iResearchFeatureAqlTestSuite () {
}
},
locale: "de_DE.UTF-16"
} };
};
view.properties(meta, true); // partial update
var result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
assertEqual(0, result.length);
var properties = view.properties().properties;
var properties = view.properties();
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(10000, properties.commit.commitIntervalMsec);
assertEqual(3, Object.keys(properties.commit.consolidate).length);
@ -464,10 +464,10 @@ function iResearchFeatureAqlTestSuite () {
col0.save({ name: "other half", text: "the brown jumps the dog" });
col0.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: { "TestCollection0": { includeAllFields: true } } } };
meta = { links: { "TestCollection0": { includeAllFields: true } } };
view.properties(meta, true); // partial update
meta = { properties: {
meta = {
commit: {
commitIntervalMsec: 10000,
consolidate: {
@ -477,7 +477,7 @@ function iResearchFeatureAqlTestSuite () {
}
},
locale: "de_DE.UTF-16"
} };
};
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -486,7 +486,7 @@ function iResearchFeatureAqlTestSuite () {
assertEqual("half", result[1].name);
assertEqual("other half", result[2].name);
assertEqual("quarter", result[3].name);
properties = view.properties().properties;
properties = view.properties();
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(10000, properties.commit.commitIntervalMsec);
assertEqual(3, Object.keys(properties.commit.consolidate).length);
@ -511,13 +511,13 @@ function iResearchFeatureAqlTestSuite () {
col1.save({ name: "other half", text: "the brown jumps the dog" });
col1.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: {
meta = { links: {
"TestCollection0": { includeAllFields: true },
"TestCollection1": { includeAllFields: true }
} } };
} };
view.properties(meta, true); // partial update
meta = { properties: {
meta = {
commit: {
commitIntervalMsec: 10000,
consolidate: {
@ -527,7 +527,7 @@ function iResearchFeatureAqlTestSuite () {
}
},
locale: "de_DE.UTF-16"
} };
};
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -536,7 +536,7 @@ function iResearchFeatureAqlTestSuite () {
assertEqual("half", result[1].name);
assertEqual("other half", result[2].name);
assertEqual("quarter", result[3].name);
properties = view.properties().properties;
properties = view.properties();
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(10000, properties.commit.commitIntervalMsec);
assertEqual(3, Object.keys(properties.commit.consolidate).length);
@ -563,14 +563,14 @@ function iResearchFeatureAqlTestSuite () {
col0.save({ name: "other half", text: "the brown jumps the dog" });
col0.save({ name: "quarter", text: "quick over" });
meta = { properties: { links: {
meta = { links: {
"TestCollection0": { includeAllFields: true },
"TestCollection1": { includeAllFields: true },
"TestCollection2": { includeAllFields: true }
} } };
} };
view.properties(meta, true); // partial update
meta = { properties: {
meta = {
commit: {
commitIntervalMsec: 10000,
consolidate: {
@ -580,7 +580,7 @@ function iResearchFeatureAqlTestSuite () {
}
},
locale: "de_DE.UTF-16"
} };
};
view.properties(meta, true); // partial update
result = db._query("FOR doc IN VIEW TestView SORT doc.name RETURN doc", null, { waitForSync: true }).toArray();
@ -589,7 +589,7 @@ function iResearchFeatureAqlTestSuite () {
assertEqual("half", result[1].name);
assertEqual("other half", result[2].name);
assertEqual("quarter", result[3].name);
properties = view.properties().properties;
properties = view.properties();
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(10000, properties.commit.commitIntervalMsec);
assertEqual(3, Object.keys(properties.commit.consolidate).length);
@ -613,7 +613,7 @@ function iResearchFeatureAqlTestSuite () {
col0.save({ b: "bar", c: "foo", z: 2 });
col0.save({ b: "baz", d: "foz", z: 3 });
var meta = { properties: { links: { "TestCollection0": { fields: { a: {} } } } } };
var meta = { links: { "TestCollection0": { fields: { a: {} } } } };
view.properties(meta, true); // partial update
var result = db._query("FOR doc IN VIEW TestView SORT doc.z RETURN doc", null, { waitForSync: true }).toArray();
@ -621,10 +621,10 @@ function iResearchFeatureAqlTestSuite () {
assertEqual(0, result[0].z);
assertEqual(1, result[1].z);
meta = { properties: { links: { "TestCollection0": { fields: { b: {} } } } } };
meta = { links: { "TestCollection0": { fields: { b: {} } } } };
view.properties(meta, true); // partial update
var updatedMeta = view.properties().properties;
var updatedMeta = view.properties();
assertNotEqual(undefined, updatedMeta.links.TestCollection0.fields.b);
assertEqual(undefined, updatedMeta.links.TestCollection0.fields.a);
@ -633,7 +633,7 @@ function iResearchFeatureAqlTestSuite () {
assertEqual(2, result[0].z);
assertEqual(3, result[1].z);
meta = { properties: { links: { "TestCollection0": { fields: { c: {} } } } } };
meta = { links: { "TestCollection0": { fields: { c: {} } } } };
view.properties(meta, false); // full update
result = db._query("FOR doc IN VIEW TestView SORT doc.z RETURN doc", null, { waitForSync: true }).toArray();

View File

@ -49,7 +49,7 @@ function iResearchAqlTestSuite () {
db._dropView("UnitTestsView");
v = db._createView("UnitTestsView", "arangosearch", {});
var meta = { properties: {
var meta = {
links: {
"UnitTestsCollection": {
includeAllFields: true,
@ -58,7 +58,7 @@ function iResearchAqlTestSuite () {
}
}
}
} };
};
v.properties(meta);
ac.save({ a: "foo", id : 0 });
@ -83,7 +83,7 @@ function iResearchAqlTestSuite () {
},
tearDown : function () {
var meta = { properties: { links : { "UnitTestsCollection": null } } };
var meta = { links : { "UnitTestsCollection": null } };
v.properties(meta);
v.drop();
db._drop("UnitTestsCollection");

View File

@ -73,9 +73,9 @@ function IResearchLinkSuite () {
/// @brief should ignore links specified at creation
////////////////////////////////////////////////////////////////////////////
testHandlingCreateWithLinks : function () {
var meta = { properties: { links: { 'testCollection' : { includeAllFields: true } } } };
var meta = { links: { 'testCollection' : { includeAllFields: true } } };
var view = db._createView("badView", "arangosearch", meta);
var links = view.properties().properties.links;
var links = view.properties().links;
assertEqual(links['testCollection'], undefined);
view.drop();
},
@ -84,17 +84,17 @@ function IResearchLinkSuite () {
/// @brief create a view and add/drop link
////////////////////////////////////////////////////////////////////////////
testAddDrop : function () {
var meta = { properties: { links: { 'testCollection' : { includeAllFields: true } } } };
var meta = { links: { 'testCollection' : { includeAllFields: true } } };
var view = db._createView("testView", "arangosearch", {});
view.properties(meta);
var links = view.properties().properties.links;
var links = view.properties().links;
assertNotEqual(links['testCollection'], undefined);
assertTrue(links['testCollection'].includeAllFields);
var newMeta = { properties: { links: { 'testCollection' : null } } };
var newMeta = { links: { 'testCollection' : null } };
view.properties(newMeta);
links = view.properties().properties.links;
links = view.properties().links;
assertEqual(links['testCollection'], undefined);
view.drop();

View File

@ -159,11 +159,11 @@ function ViewSuite () {
/// @brief modify with unacceptable properties
////////////////////////////////////////////////////////////////////////////
testErrorHandlingModifyUnacceptable : function () {
var abc = db._createView("abc", "arangosearch", { properties: { "commit": { "commitIntervalMsec": 17 } } });
var abc = db._createView("abc", "arangosearch", { "commit": { "commitIntervalMsec": 17 } });
assertEqual(abc.name(), "abc");
assertEqual(abc.properties().properties.commit.commitIntervalMsec, 17);
abc.properties({ properties: {"bogus": "junk", "commit": { "commitIntervalMsec": 7 } } });
assertEqual(abc.properties().properties.commit.commitIntervalMsec, 7);
assertEqual(abc.properties().commit.commitIntervalMsec, 17);
abc.properties({ "bogus": "junk", "commit": { "commitIntervalMsec": 7 } });
assertEqual(abc.properties().commit.commitIntervalMsec, 7);
abc.drop();
},
@ -173,12 +173,12 @@ function ViewSuite () {
testAddDrop : function () {
db._dropView("abc");
db._dropView("def");
db._createView("abc", "arangosearch", { properties: { "commit": { "commitIntervalMsec": 10 } } });
db._createView("def", "arangosearch", { properties: { "commit": { "commitIntervalMsec": 3 } } });
db._createView("abc", "arangosearch", { "commit": { "commitIntervalMsec": 10 } });
db._createView("def", "arangosearch", { "commit": { "commitIntervalMsec": 3 } });
var abc = db._view("abc");
var def = db._view("def");
var propA = abc.properties().properties;
var propD = def.properties().properties;
var propA = abc.properties();
var propD = def.properties();
assertEqual(abc.name(), "abc");
assertEqual(abc.type(), "arangosearch");
assertEqual(propA.commit.commitIntervalMsec, 10);
@ -231,16 +231,16 @@ function ViewSuite () {
/// @brief modify properties
////////////////////////////////////////////////////////////////////////////
testModifyProperties : function () {
var abc = db._createView("abc", "arangosearch", { properties: { "commit": { "commitIntervalMsec": 10 } } });
var props = abc.properties().properties;
var abc = db._createView("abc", "arangosearch", { "commit": { "commitIntervalMsec": 10 } });
var props = abc.properties();
assertEqual(abc.name(), "abc");
assertEqual(abc.type(), "arangosearch");
assertEqual(props.commit.commitIntervalMsec, 10);
abc.properties({ properties: { "commit": { "commitIntervalMsec": 7 } } });
abc.properties({ "commit": { "commitIntervalMsec": 7 } });
abc = db._view("abc");
props = abc.properties().properties;
props = abc.properties();
assertEqual(abc.name(), "abc");
assertEqual(abc.type(), "arangosearch");

View File

@ -452,7 +452,7 @@ function dumpTestSuite () {
let view = db._view("UnitTestsDumpView");
assertTrue(view !== null);
let props = view.properties().properties;
let props = view.properties();
assertEqual(Object.keys(props.links).length, 1);
assertTrue(props.hasOwnProperty("links"));
assertTrue(props.links.hasOwnProperty("UnitTestsDumpViewCollection"));

View File

@ -404,7 +404,7 @@ function dumpTestSuite () {
let view = db._view("UnitTestsDumpView");
assertTrue(view !== null);
let props = view.properties().properties;
let props = view.properties();
assertEqual(Object.keys(props.links).length, 1);
assertTrue(props.hasOwnProperty("links"));
assertTrue(props.links.hasOwnProperty("UnitTestsDumpViewCollection"));

View File

@ -225,14 +225,14 @@
try {
db._create("UnitTestsDumpViewCollection");
let view = db._createView("UnitTestsDumpView", "arangosearch", {});
view.properties({ properties: { links: {
view.properties({ links: {
"UnitTestsDumpViewCollection": {
includeAllFields: true,
fields: {
text: { analyzers: [ "text_en" ] }
}
}
} } });
} });
} catch (err) { }
})();

View File

@ -66,7 +66,7 @@ function recoverySuite () {
var v1 = db._view('UnitTestsRecovery1');
assertEqual(v1.name(), 'UnitTestsRecovery1');
assertEqual(v1.type(), 'arangosearch');
assertEqual(v1.properties().properties.commit.commitIntervalMsec, 60000);
assertEqual(v1.properties().commit.commitIntervalMsec, 60000);
}
};

View File

@ -45,7 +45,7 @@ function runSetup () {
internal.debugSetFailAt("FlushThreadDisableAll");
internal.wait(2); // make sure failure point takes effect
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._dropView('UnitTestsRecoveryFail');
db._createView('UnitTestsRecoveryFail', 'arangosearch', meta);
@ -79,19 +79,19 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryEmpty');
assertEqual(v.name(), 'UnitTestsRecoveryEmpty');
assertEqual(v.type(), 'arangosearch');
assertEqual(v.properties().properties.links, {});
assertEqual(v.properties().links, {});
v = db._view('UnitTestsRecoveryFail');
assertEqual(v.name(), 'UnitTestsRecoveryFail');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
assertEqual(v.properties().properties.links, {});
var p = v.properties().links;
assertEqual(v.properties().links, {});
var meta = { properties: { links : { "UnitTestsRecoveryDummy" : { includeAllFields : true } } } };
var meta = { links : { "UnitTestsRecoveryDummy" : { includeAllFields : true } } };
v = db._view('UnitTestsRecoveryWithLink');
assertEqual(v.name(), 'UnitTestsRecoveryWithLink');
assertEqual(v.type(), 'arangosearch');
p = v.properties().properties.links;
p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);
}

View File

@ -39,7 +39,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
for (let i = 0; i < 10000; i++) {
c.save({ a: "foo_" + i, b: "bar_" + i, c: i });
@ -71,7 +71,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -41,7 +41,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryEmpty');
db._createView('UnitTestsRecoveryEmpty', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._dropView('UnitTestsRecoveryFail');
db._createView('UnitTestsRecoveryFail', 'arangosearch', meta);
@ -75,19 +75,19 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryEmpty');
assertEqual(v.name(), 'UnitTestsRecoveryEmpty');
assertEqual(v.type(), 'arangosearch');
assertEqual(v.properties().properties.links, {});
assertEqual(v.properties().links, {});
v = db._view('UnitTestsRecoveryFail');
assertEqual(v.name(), 'UnitTestsRecoveryFail');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
assertEqual(v.properties().properties.links, {});
var p = v.properties().links;
assertEqual(v.properties().links, {});
var meta = { properties: { links : { "UnitTestsRecoveryDummy" : { includeAllFields : true } } } };
var meta = { links : { "UnitTestsRecoveryDummy" : { includeAllFields : true } } };
v = db._view('UnitTestsRecoveryWithLink');
assertEqual(v.name(), 'UnitTestsRecoveryWithLink');
assertEqual(v.type(), 'arangosearch');
p = v.properties().properties.links;
p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);
}

View File

@ -42,7 +42,7 @@ function runSetup () {
db._dropView('UnitTestsRecovery1');
var v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
v.properties(meta);
internal.wal.flush(true, true);
@ -75,7 +75,7 @@ function recoverySuite () {
testIResearchLinkDropCollectionNoFlushThread: function () {
var v1 = db._view('UnitTestsRecovery1');
assertEqual(v1.properties().properties.links, {});
assertEqual(v1.properties().links, {});
}
};

View File

@ -42,7 +42,7 @@ function runSetup () {
db._dropView('UnitTestsRecovery1');
var v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
v.properties(meta);
c.drop();
@ -71,7 +71,7 @@ function recoverySuite () {
testIResearchLinkDropCollection: function () {
var v1 = db._view('UnitTestsRecovery1');
assertEqual(v1.properties().properties.links, {});
assertEqual(v1.properties().links, {});
}
};

View File

@ -42,7 +42,7 @@ function runSetup () {
var v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
// setup link
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
v.properties(meta);
internal.wal.flush(true, true);
@ -50,7 +50,7 @@ function runSetup () {
internal.wait(2); // make sure failure point takes effect
// remove link
v.properties({ properties: { links: { 'UnitTestsRecoveryDummy': null } } });
v.properties({ links: { 'UnitTestsRecoveryDummy': null } });
c.save({ name: 'crashme' }, true);
@ -75,7 +75,7 @@ function recoverySuite () {
testIResearchLinkDropNoFlushThread: function () {
var v1 = db._view('UnitTestsRecovery1');
assertEqual(v1.properties().properties.links, {});
assertEqual(v1.properties().links, {});
}
};

View File

@ -42,11 +42,11 @@ function runSetup () {
var v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
// setup link
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
v.properties(meta);
// remove link
v.properties({ properties: { links: { 'UnitTestsRecoveryDummy': null } } });
v.properties({ links: { 'UnitTestsRecoveryDummy': null } });
c.save({ name: 'crashme' }, true);
@ -71,7 +71,7 @@ function recoverySuite () {
testIResearchLinkDrop: function () {
var v1 = db._view('UnitTestsRecovery1');
assertEqual(v1.properties().properties.links, {});
assertEqual(v1.properties().links, {});
}
};

View File

@ -80,7 +80,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertFalse(p.hasOwnProperty('UnitTestsRecoveryDummy'));
var result = AQL_EXECUTE("FOR doc IN VIEW UnitTestsRecoveryView FILTER doc.c >= 0 COLLECT WITH COUNT INTO length RETURN length", null, { }).json;

View File

@ -79,7 +79,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertFalse(p.hasOwnProperty('UnitTestsRecoveryDummy'));
var result = AQL_EXECUTE("FOR doc IN VIEW UnitTestsRecoveryView FILTER doc.c >= 0 COLLECT WITH COUNT INTO length RETURN length", null, { }).json;

View File

@ -43,7 +43,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
var v = db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
v.properties(meta);
if (db._path().indexOf("databases") !== -1) {

View File

@ -38,7 +38,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._view('UnitTestsRecoveryView').properties(meta);
var tx = {
@ -78,7 +78,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -41,7 +41,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._view('UnitTestsRecoveryView').properties(meta);
internal.wal.flush(true, true);
@ -76,7 +76,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -41,7 +41,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._view('UnitTestsRecoveryView').properties(meta);
internal.wal.flush(true, true);
@ -77,7 +77,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -41,7 +41,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._view('UnitTestsRecoveryView').properties(meta);
internal.wal.flush(true, true);
@ -76,7 +76,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -41,7 +41,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._view('UnitTestsRecoveryView').properties(meta);
internal.wal.flush(true, true);
@ -82,7 +82,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -41,7 +41,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._view('UnitTestsRecoveryView').properties(meta);
// FIXME uncomment when we'll be able to handle tons of removals properly
@ -78,7 +78,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -41,7 +41,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._view('UnitTestsRecoveryView').properties(meta);
internal.wal.flush(true, true);
@ -85,7 +85,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -41,7 +41,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._view('UnitTestsRecoveryView').properties(meta);
var tx = {
@ -81,7 +81,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -41,7 +41,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._view('UnitTestsRecoveryView').properties(meta);
internal.wal.flush(true, true);
@ -86,7 +86,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -41,7 +41,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._view('UnitTestsRecoveryView').properties(meta);
var tx = {
@ -82,7 +82,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -41,7 +41,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
db._view('UnitTestsRecoveryView').properties(meta);
for (let i = 0; i < 10000; i++) {
@ -73,7 +73,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);

View File

@ -42,7 +42,7 @@ function runSetup () {
db._dropView('UnitTestsRecovery1');
var v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
v.properties(meta);
internal.wal.flush(true, true);
@ -77,7 +77,7 @@ function recoverySuite () {
var v1 = db._view('UnitTestsRecovery1');
assertEqual(v1.name(), 'UnitTestsRecovery1');
assertEqual(v1.type(), 'arangosearch');
var p = v1.properties().properties.links;
var p = v1.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy2'));
assertTrue(p.UnitTestsRecoveryDummy2.includeAllFields);
}

View File

@ -42,7 +42,7 @@ function runSetup () {
db._dropView('UnitTestsRecovery1');
var v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
v.properties(meta);
c.rename('UnitTestsRecoveryDummy2');
@ -73,7 +73,7 @@ function recoverySuite () {
var v1 = db._view('UnitTestsRecovery1');
assertEqual(v1.name(), 'UnitTestsRecovery1');
assertEqual(v1.type(), 'arangosearch');
var p = v1.properties().properties.links;
var p = v1.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy2'));
assertTrue(p.UnitTestsRecoveryDummy2.includeAllFields);
}

View File

@ -39,7 +39,7 @@ function runSetup () {
db._dropView('UnitTestsRecoveryView');
var view = db._createView('UnitTestsRecoveryView', 'arangosearch', {});
var meta = { properties: { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } } };
var meta = { links: { 'UnitTestsRecoveryDummy': { includeAllFields: true } } };
for (let i = 0; i < 10000; i++) {
c.save({ a: "foo_" + i, b: "bar_" + i, c: i });
@ -47,7 +47,7 @@ function runSetup () {
view.properties(meta);
meta = { properties: {
meta = {
commit: {
commitIntervalMsec: 10000,
consolidate: {
@ -57,7 +57,7 @@ function runSetup () {
}
},
locale: "de_DE.UTF-16"
} };
};
view.properties(meta, true); // partial update
c.save({ name: 'crashme' }, { waitForSync: true });
@ -84,7 +84,7 @@ function recoverySuite () {
var v = db._view('UnitTestsRecoveryView');
assertEqual(v.name(), 'UnitTestsRecoveryView');
assertEqual(v.type(), 'arangosearch');
var p = v.properties().properties.links;
var p = v.properties().links;
assertTrue(p.hasOwnProperty('UnitTestsRecoveryDummy'));
assertTrue(p.UnitTestsRecoveryDummy.includeAllFields);
@ -92,7 +92,7 @@ function recoverySuite () {
assertEqual(result[0], 10000);
// validate state
var properties = v.properties().properties;
var properties = v.properties();
assertEqual(10, properties.commit.cleanupIntervalStep);
assertEqual(10000, properties.commit.commitIntervalMsec);
assertEqual(3, Object.keys(properties.commit.consolidate).length);

View File

@ -40,7 +40,7 @@ function runSetup () {
db._dropView('UnitTestsRecovery1');
var v1 = db._createView('UnitTestsRecovery1', 'arangosearch', {});
v1.properties({ properties: { "commit": { "commitIntervalMsec": 15 } } });
v1.properties({ "commit": { "commitIntervalMsec": 15 } });
c.save({ _key: 'crashme' }, true);
@ -67,7 +67,7 @@ function recoverySuite () {
var v1 = db._view('UnitTestsRecovery1');
assertEqual(v1.name(), 'UnitTestsRecovery1');
assertEqual(v1.type(), 'arangosearch');
assertEqual(v1.properties().properties.commit.commitIntervalMsec, 15);
assertEqual(v1.properties().commit.commitIntervalMsec, 15);
}
};

View File

@ -45,7 +45,7 @@ function runSetup () {
internal.wal.flush(true, true);
db._dropView('UnitTestsRecovery1');
var v2 = db._createView('UnitTestsRecovery1', 'arangosearch', { properties: { "commit": { "commitIntervalMsec": 7 } } });
var v2 = db._createView('UnitTestsRecovery1', 'arangosearch', { "commit": { "commitIntervalMsec": 7 } });
c.save({ _key: 'crashme' }, true);
@ -72,7 +72,7 @@ function recoverySuite () {
var v2 = db._view('UnitTestsRecovery1');
assertEqual(v2.name(), 'UnitTestsRecovery1');
assertEqual(v2.type(), 'arangosearch');
assertEqual(v2.properties().properties.commit.commitIntervalMsec, 7);
assertEqual(v2.properties().commit.commitIntervalMsec, 7);
}
};

View File

@ -43,7 +43,7 @@ function runSetup () {
db._dropView('UnitTestsRecovery1');
db._dropView('UnitTestsRecovery2');
v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
v.properties({ properties: { links: { 'UnitTestsDummy': { includeAllFields: true } } } });
v.properties({ links: { 'UnitTestsDummy': { includeAllFields: true } } });
db._collection('UnitTestsDummy').save({ _key: 'foo', num: 1 }, { waitForSync: true });
internal.wal.flush(true, true);

View File

@ -43,7 +43,7 @@ function runSetup () {
db._dropView('UnitTestsRecovery1');
db._dropView('UnitTestsRecovery2');
v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
v.properties({ properties: { links: { 'UnitTestsDummy': { includeAllFields: true } } } });
v.properties({ links: { 'UnitTestsDummy': { includeAllFields: true } } });
db._collection('UnitTestsDummy').save({ _key: 'foo', num: 1 }, { waitForSync: true });
v.rename('UnitTestsRecovery2');

View File

@ -43,12 +43,12 @@ function runSetup () {
db._dropView('UnitTestsRecovery1');
db._dropView('UnitTestsRecovery2');
var v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
v.properties({ properties: { "commit": { "commitIntervalMsec": 17 } } });
v.properties({ "commit": { "commitIntervalMsec": 17 } });
v.rename('UnitTestsRecovery2');
v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
v.properties({ properties: { "commit": { "commitIntervalMsec": 7 } } });
v.properties({ "commit": { "commitIntervalMsec": 7 } });
internal.wal.flush(true, true);
@ -75,10 +75,10 @@ function recoverySuite () {
var v, prop;
v = db._view('UnitTestsRecovery1');
assertEqual(v.properties().properties.commit.commitIntervalMsec, 7);
assertEqual(v.properties().commit.commitIntervalMsec, 7);
v = db._view('UnitTestsRecovery2');
assertEqual(v.properties().properties.commit.commitIntervalMsec, 17);
assertEqual(v.properties().commit.commitIntervalMsec, 17);
}
};

View File

@ -43,12 +43,12 @@ function runSetup () {
db._dropView('UnitTestsRecovery1');
db._dropView('UnitTestsRecovery2');
var v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
v.properties({ properties: { "commit": { "commitIntervalMsec": 17 } } });
v.properties({ "commit": { "commitIntervalMsec": 17 } });
v.rename('UnitTestsRecovery2');
v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
v.properties({ properties: { "commit": { "commitIntervalMsec": 7 } } });
v.properties({ "commit": { "commitIntervalMsec": 7 } });
db.UnitTestsDummy.save({ _key: 'foo' }, { waitForSync: true });
@ -75,10 +75,10 @@ function recoverySuite () {
var v, prop;
v = db._view('UnitTestsRecovery1');
assertEqual(v.properties().properties.commit.commitIntervalMsec, 7);
assertEqual(v.properties().commit.commitIntervalMsec, 7);
v = db._view('UnitTestsRecovery2');
assertEqual(v.properties().properties.commit.commitIntervalMsec, 17);
assertEqual(v.properties().commit.commitIntervalMsec, 17);
}
};

View File

@ -43,13 +43,13 @@ function runSetup () {
db._dropView('UnitTestsRecovery1');
db._dropView('UnitTestsRecovery2');
v = db._createView('UnitTestsRecovery1', 'arangosearch', {});
v.properties({ properties: { "commit": { "commitIntervalMsec": 17 } } });
v.properties({ "commit": { "commitIntervalMsec": 17 } });
v.rename('UnitTestsRecovery2');
db._dropView('UnitTestsRecovery3');
db._dropView('UnitTestsRecovery4');
v = db._createView('UnitTestsRecovery3', 'arangosearch', {});
v.properties({ properties: { "commit": { "commitIntervalMsec": 16 } } });
v.properties({ "commit": { "commitIntervalMsec": 16 } });
v.rename('UnitTestsRecovery4');
db._dropView('UnitTestsRecovery5');
@ -90,12 +90,12 @@ function recoverySuite () {
assertNull(db._view('UnitTestsRecovery1'));
v = db._view('UnitTestsRecovery2');
prop = v.properties().properties;
prop = v.properties();
assertEqual(prop.commit.commitIntervalMsec, 17);
assertNull(db._view('UnitTestsRecovery3'));
v = db._view('UnitTestsRecovery4');
prop = v.properties().properties;
prop = v.properties();
assertEqual(prop.commit.commitIntervalMsec, 16);
assertNull(db._view('UnitTestsRecovery6'));

View File

@ -257,7 +257,7 @@ SECTION("test_analyzer") {
// link collections with view
{
auto updateJson = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"links\": { \
auto updateJson = arangodb::velocypack::Parser::fromJson("{ \"links\": { \
\"testCollection0\": { \"fields\": { \
\"X\": { \"analyzers\": [ \"test_A\", \"test_B\" ] }, \
\"Y\": { \"analyzers\": [ \"test_B\" ] } \
@ -266,7 +266,7 @@ SECTION("test_analyzer") {
\"X\": { \"analyzers\": [ \"test_A\" ] }, \
\"Y\": { \"analyzers\": [ \"test_A\" ] } \
} } \
} } }");
} }");
CHECK((viewImpl->updateProperties(updateJson->slice(), false, false).ok()));
}
@ -491,7 +491,7 @@ SECTION("test_async_index") {
// link collections with view
{
auto updateJson = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"links\": { \
auto updateJson = arangodb::velocypack::Parser::fromJson("{ \"links\": { \
\"testCollection0\": { \"fields\": { \
\"same\": { \"analyzers\": [ \"test_A\", \"test_B\" ] }, \
\"duplicated\": { \"analyzers\": [ \"test_B\" ] } \
@ -500,7 +500,7 @@ SECTION("test_async_index") {
\"same\": { \"analyzers\": [ \"test_A\" ] }, \
\"duplicated\": { \"analyzers\": [ \"test_A\" ] } \
} } \
} } }");
} }");
CHECK((viewImpl->updateProperties(updateJson->slice(), false, false).ok()));
}
@ -869,7 +869,7 @@ SECTION("test_fields") {
// link collections with view
{
auto updateJson = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"links\": { \
auto updateJson = arangodb::velocypack::Parser::fromJson("{ \"links\": { \
\"testCollection0\": { \"fields\": { \
\"X\": { }, \
\"Y\": { } \
@ -877,7 +877,7 @@ SECTION("test_fields") {
\"testCollection1\": { \"fields\": { \
\"X\": { } \
} } \
} } }");
} }");
CHECK((viewImpl->updateProperties(updateJson->slice(), false, false).ok()));
}
@ -937,4 +937,4 @@ SECTION("test_fields") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -375,7 +375,7 @@ SECTION("test_init") {
{
auto collectionJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection\", \"id\": 101 }");
auto linkJson = arangodb::velocypack::Parser::fromJson("{ \"type\": \"arangosearch\", \"view\": 43 }");
auto viewJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testView\", \"id\": 43, \"type\": \"arangosearch\", \"properties\": { \"collections\": [ 101 ] } }");
auto viewJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testView\", \"id\": 43, \"type\": \"arangosearch\", \"collections\": [ 101 ] }");
TRI_vocbase_t vocbase(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 1, "testVocbase");
auto* logicalCollection = vocbase.createCollection(collectionJson->slice());
REQUIRE((nullptr != logicalCollection));

View File

@ -252,10 +252,10 @@ TEST_CASE("IResearchQueryTestAggregate", "[iresearch][iresearch-query]") {
REQUIRE((false == !impl));
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"includeAllFields\": true, \"trackListPositions\": true },"
"\"testCollection1\": { \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((impl->updateProperties(updateJson->slice(), true, false).ok()));
std::set<TRI_voc_cid_t> cids;
@ -414,4 +414,4 @@ TEST_CASE("IResearchQueryTestAggregate", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -252,10 +252,10 @@ TEST_CASE("IResearchQueryTestAnd", "[iresearch][iresearch-query]") {
REQUIRE((false == !impl));
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"analyzers\": [ \"test_analyzer\", \"identity\" ], \"includeAllFields\": true, \"trackListPositions\": true },"
"\"testCollection1\": { \"analyzers\": [ \"test_analyzer\", \"identity\" ], \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((impl->updateProperties(updateJson->slice(), true, false).ok()));
std::set<TRI_voc_cid_t> cids;
@ -736,4 +736,4 @@ TEST_CASE("IResearchQueryTestAnd", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -260,10 +260,10 @@ TEST_CASE("IResearchQueryTestBooleanTerm", "[iresearch][iresearch-query]") {
REQUIRE((false == !impl));
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"includeAllFields\": true, \"trackListPositions\": true },"
"\"testCollection1\": { \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((impl->updateProperties(updateJson->slice(), true, false).ok()));
std::set<TRI_voc_cid_t> cids;
@ -2427,4 +2427,4 @@ TEST_CASE("IResearchQueryTestBooleanTerm", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -252,10 +252,10 @@ TEST_CASE("IResearchQueryTestComplexBoolean", "[iresearch][iresearch-query]") {
REQUIRE((false == !impl));
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"includeAllFields\": true, \"nestListValues\": true },"
"\"testCollection1\": { \"includeAllFields\": true, \"analyzers\": [ \"test_analyzer\", \"identity\" ] }"
"}}}"
"}}"
);
CHECK((impl->updateProperties(updateJson->slice(), true, false).ok()));
std::set<TRI_voc_cid_t> cids;
@ -474,4 +474,4 @@ TEST_CASE("IResearchQueryTestComplexBoolean", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -261,10 +261,10 @@ TEST_CASE("IResearchQueryTestExists", "[iresearch][iresearch-query]") {
REQUIRE((false == !impl));
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"includeAllFields\": true, \"trackListPositions\": true },"
"\"testCollection1\": { \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((impl->updateProperties(updateJson->slice(), true, false).ok()));
std::set<TRI_voc_cid_t> cids;
@ -1459,4 +1459,4 @@ TEST_CASE("IResearchQueryTestExists", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -252,10 +252,10 @@ TEST_CASE("IResearchQueryTestIn", "[iresearch][iresearch-query]") {
REQUIRE((false == !impl));
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"includeAllFields\": true, \"trackListPositions\": true },"
"\"testCollection1\": { \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((impl->updateProperties(updateJson->slice(), true, false).ok()));
std::set<TRI_voc_cid_t> cids;
@ -521,4 +521,4 @@ TEST_CASE("IResearchQueryTestIn", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -352,10 +352,10 @@ TEST_CASE("IResearchQueryTestJoinDuplicateDataSource", "[iresearch][iresearch-qu
// add link to collection
{
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"collection_1\": { \"analyzers\": [ \"test_analyzer\", \"identity\" ], \"includeAllFields\": true, \"trackListPositions\": true },"
"\"collection_2\": { \"analyzers\": [ \"test_analyzer\", \"identity\" ], \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((view->updateProperties(updateJson->slice(), true, false).ok()));
@ -370,7 +370,7 @@ TEST_CASE("IResearchQueryTestJoinDuplicateDataSource", "[iresearch][iresearch-qu
CHECK(slice.get("name").copyString() == "testView");
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
CHECK(slice.get("deleted").isNone()); // no system properties
auto tmpSlice = slice.get("properties").get("links");
auto tmpSlice = slice.get("links");
CHECK((true == tmpSlice.isObject() && 2 == tmpSlice.length()));
}
@ -530,10 +530,10 @@ TEST_CASE("IResearchQueryTestJoin", "[iresearch][iresearch-query]") {
// add link to collection
{
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"collection_1\": { \"analyzers\": [ \"test_analyzer\", \"identity\" ], \"includeAllFields\": true, \"trackListPositions\": true },"
"\"collection_2\": { \"analyzers\": [ \"test_analyzer\", \"identity\" ], \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((view->updateProperties(updateJson->slice(), true, false).ok()));
@ -548,7 +548,7 @@ TEST_CASE("IResearchQueryTestJoin", "[iresearch][iresearch-query]") {
CHECK(slice.get("name").copyString() == "testView");
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
CHECK(slice.get("deleted").isNone()); // no system properties
auto tmpSlice = slice.get("properties").get("links");
auto tmpSlice = slice.get("links");
CHECK((true == tmpSlice.isObject() && 2 == tmpSlice.length()));
}
@ -1664,4 +1664,4 @@ TEST_CASE("IResearchQueryTestJoin", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -258,10 +258,10 @@ TEST_CASE("IResearchQueryTestNullTerm", "[iresearch][iresearch-query]") {
REQUIRE((false == !impl));
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"includeAllFields\": true, \"trackListPositions\": true },"
"\"testCollection1\": { \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((impl->updateProperties(updateJson->slice(), true, false).ok()));
std::set<TRI_voc_cid_t> cids;
@ -1449,4 +1449,4 @@ TEST_CASE("IResearchQueryTestNullTerm", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -216,10 +216,10 @@ TEST_CASE("IResearchQueryTestNumericTerm", "[iresearch][iresearch-query]") {
// add link to collection
{
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\" : {"
"{ \"links\" : {"
"\"collection_1\" : { \"includeAllFields\" : true },"
"\"collection_2\" : { \"includeAllFields\" : true }"
"}}}"
"}}"
);
CHECK((view->updateProperties(updateJson->slice(), true, false).ok()));
@ -234,7 +234,7 @@ TEST_CASE("IResearchQueryTestNumericTerm", "[iresearch][iresearch-query]") {
CHECK(slice.get("name").copyString() == "testView");
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
CHECK(slice.get("deleted").isNone()); // no system properties
auto tmpSlice = slice.get("properties").get("links");
auto tmpSlice = slice.get("links");
CHECK((true == tmpSlice.isObject() && 2 == tmpSlice.length()));
}
@ -3138,4 +3138,4 @@ TEST_CASE("IResearchQueryTestNumericTerm", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -207,10 +207,10 @@ TEST_CASE("IResearchQueryTestOr", "[iresearch][iresearch-query]") {
// add link to collection
{
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"collection_1\": { \"analyzers\": [ \"test_analyzer\", \"identity\" ], \"includeAllFields\": true, \"trackListPositions\": true },"
"\"collection_2\": { \"analyzers\": [ \"test_analyzer\", \"identity\" ], \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((view->updateProperties(updateJson->slice(), true, false).ok()));
@ -225,7 +225,7 @@ TEST_CASE("IResearchQueryTestOr", "[iresearch][iresearch-query]") {
CHECK(slice.get("name").copyString() == "testView");
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
CHECK(slice.get("deleted").isNone()); // no system properties
auto tmpSlice = slice.get("properties").get("links");
auto tmpSlice = slice.get("links");
CHECK((true == tmpSlice.isObject() && 2 == tmpSlice.length()));
}
@ -673,4 +673,4 @@ TEST_CASE("IResearchQueryTestOr", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -252,10 +252,10 @@ TEST_CASE("IResearchQueryTestPhrase", "[iresearch][iresearch-query]") {
REQUIRE((false == !impl));
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"analyzers\": [ \"test_analyzer\", \"identity\" ], \"includeAllFields\": true, \"trackListPositions\": true },"
"\"testCollection1\": { \"analyzers\": [ \"test_analyzer\", \"identity\" ], \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((impl->updateProperties(updateJson->slice(), true, false).ok()));
std::set<TRI_voc_cid_t> cids;
@ -1040,4 +1040,4 @@ TEST_CASE("IResearchQueryTestPhrase", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -207,10 +207,10 @@ TEST_CASE("IResearchQueryTestSelectAll", "[iresearch][iresearch-query]") {
// add link to collection
{
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\" : {"
"{ \"links\" : {"
"\"collection_1\" : { \"includeAllFields\" : true },"
"\"collection_2\" : { \"includeAllFields\" : true }"
"}}}"
"}}"
);
CHECK((view->updateProperties(updateJson->slice(), true, false).ok()));
@ -225,7 +225,7 @@ TEST_CASE("IResearchQueryTestSelectAll", "[iresearch][iresearch-query]") {
CHECK(slice.get("name").copyString() == "testView");
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
CHECK(slice.get("deleted").isNone()); // no system properties
auto tmpSlice = slice.get("properties").get("links");
auto tmpSlice = slice.get("links");
CHECK((true == tmpSlice.isObject() && 2 == tmpSlice.length()));
}
@ -509,4 +509,4 @@ TEST_CASE("IResearchQueryTestSelectAll", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -207,10 +207,10 @@ TEST_CASE("IResearchQueryTestStartsWith", "[iresearch][iresearch-query]") {
// add link to collection
{
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\" : {"
"{ \"links\" : {"
"\"collection_1\" : { \"includeAllFields\" : true },"
"\"collection_2\" : { \"includeAllFields\" : true }"
"}}}"
"}}"
);
CHECK((view->updateProperties(updateJson->slice(), true, false).ok()));
@ -225,7 +225,7 @@ TEST_CASE("IResearchQueryTestStartsWith", "[iresearch][iresearch-query]") {
CHECK(slice.get("name").copyString() == "testView");
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
CHECK(slice.get("deleted").isNone()); // no system properties
auto tmpSlice = slice.get("properties").get("links");
auto tmpSlice = slice.get("links");
CHECK((true == tmpSlice.isObject() && 2 == tmpSlice.length()));
}
@ -419,4 +419,4 @@ TEST_CASE("IResearchQueryTestStartsWith", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -242,10 +242,10 @@ TEST_CASE("IResearchQueryTestStringTerm", "[iresearch][iresearch-query]") {
// add link to collection
{
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\" : {"
"{ \"links\" : {"
"\"collection_1\" : { \"includeAllFields\" : true },"
"\"collection_2\" : { \"includeAllFields\" : true }"
"}}}"
"}}"
);
CHECK((view->updateProperties(updateJson->slice(), true, false).ok()));
@ -260,7 +260,7 @@ TEST_CASE("IResearchQueryTestStringTerm", "[iresearch][iresearch-query]") {
CHECK(slice.get("name").copyString() == "testView");
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
CHECK(slice.get("deleted").isNone()); // no system properties
auto tmpSlice = slice.get("properties").get("links");
auto tmpSlice = slice.get("links");
CHECK((true == tmpSlice.isObject() && 2 == tmpSlice.length()));
}
@ -2764,4 +2764,4 @@ TEST_CASE("IResearchQueryTestStringTerm", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -260,10 +260,10 @@ TEST_CASE("IResearchQueryTestTokens", "[iresearch][iresearch-query]") {
REQUIRE((false == !impl));
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"includeAllFields\": true, \"trackListPositions\": true },"
"\"testCollection1\": { \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((impl->updateProperties(updateJson->slice(), true, false).ok()));
std::set<TRI_voc_cid_t> cids;
@ -417,4 +417,4 @@ TEST_CASE("IResearchQueryTestTokens", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -293,10 +293,10 @@ TEST_CASE("IResearchQueryTestTraversal", "[iresearch][iresearch-query]") {
REQUIRE((false == !impl));
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"includeAllFields\": true, \"trackListPositions\": true },"
"\"testCollection1\": { \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((impl->updateProperties(updateJson->slice(), true, false).ok()));
std::set<TRI_voc_cid_t> cids;
@ -373,4 +373,4 @@ TEST_CASE("IResearchQueryTestTraversal", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

View File

@ -252,10 +252,10 @@ TEST_CASE("IResearchQueryTestValue", "[iresearch][iresearch-query]") {
REQUIRE((false == !impl));
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"includeAllFields\": true, \"trackListPositions\": true },"
"\"testCollection1\": { \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((impl->updateProperties(updateJson->slice(), true, false).ok()));
std::set<TRI_voc_cid_t> cids;
@ -997,4 +997,4 @@ TEST_CASE("IResearchQueryTestValue", "[iresearch][iresearch-query]") {
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -255,7 +255,7 @@ SECTION("test_type") {
SECTION("test_rename") {
auto json = arangodb::velocypack::Parser::fromJson(
"{ \"name\": \"testView\", \"type\": \"arangosearch\", \"id\": \"1\", \"properties\": { \"collections\": [1,2,3] } }");
"{ \"name\": \"testView\", \"type\": \"arangosearch\", \"id\": \"1\", \"collections\": [1,2,3] }");
Vocbase vocbase(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_COORDINATOR, 1, "testVocbase");
@ -335,7 +335,7 @@ SECTION("test_defaults") {
arangodb::iresearch::IResearchViewMeta meta;
std::string error;
CHECK(8 == slice.length());
CHECK((9U == slice.length()));
CHECK((slice.hasKey("globallyUniqueId") && slice.get("globallyUniqueId").isString() && false == slice.get("globallyUniqueId").copyString().empty()));
CHECK(slice.get("id").copyString() == "1");
CHECK((slice.hasKey("isSystem") && slice.get("isSystem").isBoolean() && false == slice.get("isSystem").getBoolean()));
@ -343,9 +343,6 @@ SECTION("test_defaults") {
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
CHECK(slice.hasKey("planId"));
CHECK(false == slice.get("deleted").getBool());
slice = slice.get("properties");
CHECK(slice.isObject());
CHECK((2U == slice.length()));
CHECK((!slice.hasKey("links"))); // for persistence so no links
CHECK((meta.init(slice, error) && expectedMeta == meta));
}
@ -361,15 +358,12 @@ SECTION("test_defaults") {
arangodb::iresearch::IResearchViewMeta meta;
std::string error;
CHECK(4 == slice.length());
CHECK((6U == slice.length()));
CHECK(slice.get("id").copyString() == "1");
CHECK(slice.get("name").copyString() == "testView");
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
CHECK(!slice.hasKey("planId"));
CHECK(!slice.hasKey("deleted"));
slice = slice.get("properties");
CHECK(slice.isObject());
CHECK((3U == slice.length()));
CHECK((slice.hasKey("links") && slice.get("links").isObject() && 0 == slice.get("links").length()));
CHECK((meta.init(slice, error) && expectedMeta == meta));
}
@ -633,7 +627,7 @@ SECTION("test_update_properties") {
arangodb::iresearch::IResearchViewMeta meta;
error.clear(); // clear error
CHECK(meta.init(builder.slice().get("properties"), error));
CHECK(meta.init(builder.slice(), error));
CHECK(error.empty());
CHECK(meta == arangodb::iresearch::IResearchViewMeta::DEFAULT());
}
@ -642,7 +636,7 @@ SECTION("test_update_properties") {
// update properties - full update
{
auto props = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"commit\": { \"cleanupIntervalStep\": 42, \"commitIntervalMsec\": 50 } } }");
auto props = arangodb::velocypack::Parser::fromJson("{ \"commit\": { \"cleanupIntervalStep\": 42, \"commitIntervalMsec\": 50 } }");
CHECK(view->updateProperties(props->slice(), false, true).ok());
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
planVersion = arangodb::tests::getCurrentPlanVersion();
@ -671,7 +665,7 @@ SECTION("test_update_properties") {
expected._commit._cleanupIntervalStep = 42;
expected._commit._commitIntervalMsec = 50;
error.clear(); // clear error
CHECK(meta.init(builder.slice().get("properties"), error));
CHECK(meta.init(builder.slice(), error));
CHECK(error.empty());
CHECK(expected == meta);
}
@ -685,7 +679,7 @@ SECTION("test_update_properties") {
arangodb::iresearch::IResearchViewMeta meta;
error.clear(); // clear error
CHECK(meta.init(builder.slice().get("properties"), error));
CHECK(meta.init(builder.slice(), error));
CHECK(error.empty());
CHECK(meta == arangodb::iresearch::IResearchViewMeta::DEFAULT());
}
@ -693,7 +687,7 @@ SECTION("test_update_properties") {
// partially update properties
{
auto props = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"commit\": { \"commitIntervalMsec\": 42 } } }");
auto props = arangodb::velocypack::Parser::fromJson("{ \"commit\": { \"commitIntervalMsec\": 42 } }");
CHECK(fullyUpdatedView->updateProperties(props->slice(), true, true).ok());
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
planVersion = arangodb::tests::getCurrentPlanVersion();
@ -722,7 +716,7 @@ SECTION("test_update_properties") {
expected._commit._cleanupIntervalStep = 42;
expected._commit._commitIntervalMsec = 42;
error.clear(); // clear error
CHECK(meta.init(builder.slice().get("properties"), error));
CHECK(meta.init(builder.slice(), error));
CHECK(error.empty());
CHECK(expected == meta);
}
@ -847,11 +841,11 @@ SECTION("test_update_links_partial_remove") {
// explicitly specify id for the sake of tests
auto linksJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\" : {"
"{ \"links\": {"
" \"testCollection1\" : { \"id\": \"1\", \"includeAllFields\" : true }, "
" \"2\" : { \"id\": \"2\", \"trackListPositions\" : true }, "
" \"testCollection3\" : { \"id\": \"3\" } "
"} } }"
"} }"
);
CHECK(view->updateProperties(linksJson->slice(), true, true).ok()); // add links
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
@ -889,7 +883,7 @@ SECTION("test_update_links_partial_remove") {
view->toVelocyPack(info, true, false);
info.close();
auto const properties = info.slice().get("properties");
auto const properties = info.slice();
CHECK(properties.hasKey(arangodb::iresearch::StaticStrings::LinksField));
auto const linksSlice = properties.get(arangodb::iresearch::StaticStrings::LinksField);
CHECK(linksSlice.isObject());
@ -1087,9 +1081,9 @@ SECTION("test_update_links_partial_remove") {
}
auto const updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\" : {"
"{ \"links\": {"
" \"2\" : null "
"} } }"
"} }"
);
CHECK(view->updateProperties(updateJson->slice(), true, true).ok());
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
@ -1126,7 +1120,7 @@ SECTION("test_update_links_partial_remove") {
view->toVelocyPack(info, true, false);
info.close();
auto const properties = info.slice().get("properties");
auto const properties = info.slice();
CHECK(properties.hasKey(arangodb::iresearch::StaticStrings::LinksField));
auto const linksSlice = properties.get(arangodb::iresearch::StaticStrings::LinksField);
CHECK(linksSlice.isObject());
@ -1403,10 +1397,10 @@ SECTION("test_update_links_partial_add") {
// explicitly specify id for the sake of tests
auto linksJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\" : {"
"{ \"links\": {"
" \"testCollection1\" : { \"id\": \"1\", \"includeAllFields\" : true }, "
" \"testCollection3\" : { \"id\": \"3\" } "
"} } }"
"} }"
);
CHECK(view->updateProperties(linksJson->slice(), true, true).ok()); // add links
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
@ -1443,7 +1437,7 @@ SECTION("test_update_links_partial_add") {
view->toVelocyPack(info, true, false);
info.close();
auto const properties = info.slice().get("properties");
auto const properties = info.slice();
CHECK(properties.hasKey(arangodb::iresearch::StaticStrings::LinksField));
auto const linksSlice = properties.get(arangodb::iresearch::StaticStrings::LinksField);
CHECK(linksSlice.isObject());
@ -1581,9 +1575,9 @@ SECTION("test_update_links_partial_add") {
}
auto const updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\" : {"
"{ \"links\": {"
" \"2\" : { \"id\": \"2\", \"trackListPositions\" : true } "
"} } }"
"} }"
);
CHECK(view->updateProperties(updateJson->slice(), true, true).ok());
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
@ -1621,7 +1615,7 @@ SECTION("test_update_links_partial_add") {
view->toVelocyPack(info, true, false);
info.close();
auto const properties = info.slice().get("properties");
auto const properties = info.slice();
CHECK(properties.hasKey(arangodb::iresearch::StaticStrings::LinksField));
auto const linksSlice = properties.get(arangodb::iresearch::StaticStrings::LinksField);
CHECK(linksSlice.isObject());
@ -1811,7 +1805,7 @@ SECTION("test_update_links_partial_add") {
// partial update - empty delta
{
auto const updateJson = arangodb::velocypack::Parser::fromJson("{ \"properties\": {} }");
auto const updateJson = arangodb::velocypack::Parser::fromJson("{ }");
CHECK(view->updateProperties(updateJson->slice(), true, true).ok()); // empty properties -> should not affect plan version
CHECK(planVersion == arangodb::tests::getCurrentPlanVersion()); // plan did't change version
}
@ -1969,10 +1963,10 @@ SECTION("test_update_links_replace") {
// explicitly specify id for the sake of tests
auto linksJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\" : {"
"{ \"links\": {"
" \"testCollection1\" : { \"id\": \"1\", \"includeAllFields\" : true }, "
" \"testCollection3\" : { \"id\": \"3\" } "
"} } }"
"} }"
);
CHECK(view->updateProperties(linksJson->slice(), false, true).ok()); // add link
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
@ -2009,7 +2003,7 @@ SECTION("test_update_links_replace") {
view->toVelocyPack(info, true, false);
info.close();
auto const properties = info.slice().get("properties");
auto const properties = info.slice();
CHECK(properties.hasKey(arangodb::iresearch::StaticStrings::LinksField));
auto const linksSlice = properties.get(arangodb::iresearch::StaticStrings::LinksField);
CHECK(linksSlice.isObject());
@ -2158,9 +2152,9 @@ SECTION("test_update_links_replace") {
}
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\" : {"
"{ \"links\": {"
" \"2\" : { \"id\": \"2\", \"trackListPositions\" : true } "
"} } }"
"} }"
);
CHECK(view->updateProperties(updateJson->slice(), false, true).ok());
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
@ -2196,7 +2190,7 @@ SECTION("test_update_links_replace") {
view->toVelocyPack(info, true, false);
info.close();
auto const properties = info.slice().get("properties");
auto const properties = info.slice();
CHECK(properties.hasKey(arangodb::iresearch::StaticStrings::LinksField));
auto const linksSlice = properties.get(arangodb::iresearch::StaticStrings::LinksField);
CHECK(linksSlice.isObject());
@ -2278,10 +2272,10 @@ SECTION("test_update_links_replace") {
}
updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\" : {"
"{ \"links\": {"
" \"testCollection1\" : { \"id\": \"1\", \"includeAllFields\" : true }, "
" \"2\" : null "
"} } }"
"} }"
);
CHECK(view->updateProperties(updateJson->slice(), false, true).ok());
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
@ -2317,7 +2311,7 @@ SECTION("test_update_links_replace") {
view->toVelocyPack(info, true, false);
info.close();
auto const properties = info.slice().get("properties");
auto const properties = info.slice();
CHECK(properties.hasKey(arangodb::iresearch::StaticStrings::LinksField));
auto const linksSlice = properties.get(arangodb::iresearch::StaticStrings::LinksField);
CHECK(linksSlice.isObject());
@ -2536,11 +2530,11 @@ SECTION("test_update_links_clear") {
// explicitly specify id for the sake of tests
auto linksJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"locale\": \"en\", \"links\" : {"
"{ \"locale\": \"en\", \"links\": {"
" \"testCollection1\" : { \"id\": \"1\", \"includeAllFields\" : true }, "
" \"2\" : { \"id\": \"2\", \"trackListPositions\" : true }, "
" \"testCollection3\" : { \"id\": \"3\" } "
"} } }"
"} }"
);
CHECK(view->updateProperties(linksJson->slice(), false, true).ok()); // add link
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
@ -2578,7 +2572,7 @@ SECTION("test_update_links_clear") {
view->toVelocyPack(info, true, false);
info.close();
auto const properties = info.slice().get("properties");
auto const properties = info.slice();
CHECK(properties.hasKey(arangodb::iresearch::StaticStrings::LinksField));
auto const linksSlice = properties.get(arangodb::iresearch::StaticStrings::LinksField);
CHECK(linksSlice.isObject());
@ -2786,7 +2780,7 @@ SECTION("test_update_links_clear") {
CHECK(arangodb::AgencyComm().setValue(currentCollection3Path, value->slice(), 0.0).successful());
}
auto const updateJson = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"links\": {} } }");
auto const updateJson = arangodb::velocypack::Parser::fromJson("{ \"links\": {} }");
CHECK(view->updateProperties(updateJson->slice(), false, true).ok());
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
planVersion = arangodb::tests::getCurrentPlanVersion();
@ -2817,7 +2811,7 @@ SECTION("test_update_links_clear") {
view->toVelocyPack(info, true, false);
info.close();
auto const properties = info.slice().get("properties");
auto const properties = info.slice();
CHECK((properties.hasKey(arangodb::iresearch::StaticStrings::LinksField)));
auto links = properties.get(arangodb::iresearch::StaticStrings::LinksField);
CHECK((links.isObject()));
@ -2924,7 +2918,7 @@ SECTION("test_drop_link") {
CHECK(arangodb::AgencyComm().setValue(currentCollectionPath, value->slice(), 0.0).successful());
}
auto linksJson = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"links\" : { \"testCollection\" : { \"includeAllFields\" : true } } } }");
auto linksJson = arangodb::velocypack::Parser::fromJson("{ \"links\": { \"testCollection\" : { \"includeAllFields\" : true } } }");
CHECK(view->updateProperties(linksJson->slice(), true, true).ok()); // add link
CHECK(planVersion < arangodb::tests::getCurrentPlanVersion()); // plan version changed
planVersion = arangodb::tests::getCurrentPlanVersion();
@ -2958,7 +2952,7 @@ SECTION("test_drop_link") {
view->toVelocyPack(info, true, false);
info.close();
auto const properties = info.slice().get("properties");
auto const properties = info.slice();
CHECK(properties.hasKey(arangodb::iresearch::StaticStrings::LinksField));
auto const linksSlice = properties.get(arangodb::iresearch::StaticStrings::LinksField);
CHECK(linksSlice.isObject());
@ -3069,7 +3063,7 @@ SECTION("test_drop_link") {
view->toVelocyPack(info, true, false);
info.close();
auto const properties = info.slice().get("properties");
auto const properties = info.slice();
CHECK((properties.hasKey(arangodb::iresearch::StaticStrings::LinksField)));
auto links = properties.get(arangodb::iresearch::StaticStrings::LinksField);
CHECK((links.isObject()));

View File

@ -518,9 +518,9 @@ SECTION("test_query") {
// snapshot isolation
{
auto links = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \
auto links = arangodb::velocypack::Parser::fromJson("{ \
\"links\": { \"testCollection\": { \"includeAllFields\" : true } } \
}}");
}");
auto collectionJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection\", \"id\":442 }");
TRI_vocbase_t* vocbase; // will be owned by DatabaseFeature
@ -618,7 +618,7 @@ SECTION("test_query") {
{
auto collectionJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection\" }");
auto viewCreateJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testView\", \"type\": \"arangosearch\" }");
auto viewUpdateJson = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"links\": { \"testCollection\": { \"includeAllFields\": true } } } }");
auto viewUpdateJson = arangodb::velocypack::Parser::fromJson("{ \"links\": { \"testCollection\": { \"includeAllFields\": true } } }");
auto* feature = arangodb::application_features::ApplicationServer::lookupFeature<
arangodb::FlushFeature
>("Flush");
@ -821,14 +821,10 @@ SECTION("test_toVelocyPack") {
wiew->toVelocyPack(builder, true, false);
builder.close();
auto slice = builder.slice();
CHECK((4 == slice.length()));
CHECK((5U == slice.length()));
CHECK((slice.hasKey("id") && slice.get("id").isString() && std::string("2") == slice.get("id").copyString()));
CHECK((slice.hasKey("name") && slice.get("name").isString() && std::string("testView") == slice.get("name").copyString()));
CHECK((slice.hasKey("type") && slice.get("type").isString() && arangodb::iresearch::DATA_SOURCE_TYPE.name() == slice.get("type").copyString()));
CHECK((slice.hasKey("properties")));
auto props = slice.get("properties");
CHECK((props.isObject()));
CHECK((2U == props.length()));
}
// includeSystem
@ -967,7 +963,7 @@ SECTION("test_updateProperties") {
// update empty (partial)
{
auto collectionJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection\" }");
auto viewJson = arangodb::velocypack::Parser::fromJson("{ \"id\": \"42\", \"name\": \"testView\", \"type\": \"arangosearch\", \"properties\": { \"collections\": [ 3, 4, 5 ], \"commit\": { \"cleanupIntervalStep\": 24, \"commitIntervalMsec\": 42 } } }");
auto viewJson = arangodb::velocypack::Parser::fromJson("{ \"id\": \"42\", \"name\": \"testView\", \"type\": \"arangosearch\", \"collections\": [ 3, 4, 5 ], \"commit\": { \"cleanupIntervalStep\": 24, \"commitIntervalMsec\": 42 } }");
TRI_vocbase_t* vocbase; // will be owned by DatabaseFeature
REQUIRE((TRI_ERROR_NO_ERROR == databaseFeature->createDatabase(0, "testDatabase" TOSTRING(__LINE__), vocbase)));
REQUIRE((nullptr != vocbase));
@ -989,9 +985,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((2U == slice.length()));
CHECK((5U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 24 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1000,7 +994,7 @@ SECTION("test_updateProperties") {
}
{
auto update = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"collections\": [ 6, 7, 8, 9 ], \"commit\": { \"commitIntervalMsec\": 52 }, \"links\": { \"testCollection\": {} } } }");
auto update = arangodb::velocypack::Parser::fromJson("{ \"collections\": [ 6, 7, 8, 9 ], \"commit\": { \"commitIntervalMsec\": 52 }, \"links\": { \"testCollection\": {} } }");
CHECK((true == wiew->updateProperties(update->slice(), true, true).ok()));
}
@ -1013,9 +1007,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((2U == slice.length()));
CHECK((5U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 24 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1038,9 +1030,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((3U == slice.length()));
CHECK((6U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 24 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1058,10 +1048,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
CHECK((8U == slice.length()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((3U == slice.length()));
CHECK((10U == slice.length()));
CHECK((slice.hasKey("collections") && slice.get("collections").isArray() && 0 == slice.get("collections").length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
@ -1074,7 +1061,7 @@ SECTION("test_updateProperties") {
// update empty (full)
{
auto collectionJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection\" }");
auto viewJson = arangodb::velocypack::Parser::fromJson("{ \"id\": \"42\", \"name\": \"testView\", \"type\": \"arangosearch\", \"properties\": { \"collections\": [ 3, 4, 5 ], \"commit\": { \"cleanupIntervalStep\": 24, \"commitIntervalMsec\": 42 } } }");
auto viewJson = arangodb::velocypack::Parser::fromJson("{ \"id\": \"42\", \"name\": \"testView\", \"type\": \"arangosearch\", \"collections\": [ 3, 4, 5 ], \"commit\": { \"cleanupIntervalStep\": 24, \"commitIntervalMsec\": 42 } }");
TRI_vocbase_t* vocbase; // will be owned by DatabaseFeature
REQUIRE((TRI_ERROR_NO_ERROR == databaseFeature->createDatabase(0, "testDatabase" TOSTRING(__LINE__), vocbase)));
REQUIRE((nullptr != vocbase));
@ -1096,9 +1083,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((2U == slice.length()));
CHECK((5U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 24 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1107,7 +1092,7 @@ SECTION("test_updateProperties") {
}
{
auto update = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"collections\": [ 6, 7, 8, 9 ], \"links\": { \"testCollection\": {} }, \"commit\": { \"commitIntervalMsec\": 52 } } }");
auto update = arangodb::velocypack::Parser::fromJson("{ \"collections\": [ 6, 7, 8, 9 ], \"links\": { \"testCollection\": {} }, \"commit\": { \"commitIntervalMsec\": 52 } }");
CHECK((true == wiew->updateProperties(update->slice(), false, true).ok()));
}
@ -1120,9 +1105,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((2U == slice.length()));
CHECK((5U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 10 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1145,9 +1128,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((3U == slice.length()));
CHECK((6U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 10 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1165,10 +1146,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
CHECK((8U == slice.length()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((3U == slice.length()));
CHECK((10U == slice.length()));
CHECK((slice.hasKey("collections") && slice.get("collections").isArray() && 0 == slice.get("collections").length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
@ -1181,7 +1159,7 @@ SECTION("test_updateProperties") {
// update non-empty (partial)
{
auto collectionJson = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection\" }");
auto viewJson = arangodb::velocypack::Parser::fromJson("{ \"id\": \"42\", \"name\": \"testView\", \"type\": \"arangosearch\", \"properties\": { \"collections\": [ 3, 4, 5 ], \"commit\": { \"cleanupIntervalStep\": 24, \"commitIntervalMsec\": 42 } } }");
auto viewJson = arangodb::velocypack::Parser::fromJson("{ \"id\": \"42\", \"name\": \"testView\", \"type\": \"arangosearch\", \"collections\": [ 3, 4, 5 ], \"commit\": { \"cleanupIntervalStep\": 24, \"commitIntervalMsec\": 42 } }");
TRI_vocbase_t* vocbase; // will be owned by DatabaseFeature
REQUIRE((TRI_ERROR_NO_ERROR == databaseFeature->createDatabase(0, "testDatabase" TOSTRING(__LINE__), vocbase)));
REQUIRE((nullptr != vocbase));
@ -1208,9 +1186,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((2U == slice.length()));
CHECK((5U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 24 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1219,7 +1195,7 @@ SECTION("test_updateProperties") {
}
{
auto update = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"collections\": [ 6, 7, 8 ], \"links\": { \"testCollection\": {} }, \"commit\": { \"commitIntervalMsec\": 52 } } }");
auto update = arangodb::velocypack::Parser::fromJson("{ \"collections\": [ 6, 7, 8 ], \"links\": { \"testCollection\": {} }, \"commit\": { \"commitIntervalMsec\": 52 } }");
CHECK((true == wiew->updateProperties(update->slice(), true, true).ok()));
}
@ -1232,9 +1208,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((2U == slice.length()));
CHECK((5U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 24 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1254,9 +1228,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((3U == slice.length()));
CHECK((6U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 24 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1274,10 +1246,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
CHECK((8U == slice.length()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((3U == slice.length()));
CHECK((10U == slice.length()));
CHECK((slice.hasKey("collections") && slice.get("collections").isArray() && 0 == slice.get("collections").length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
@ -1291,7 +1260,7 @@ SECTION("test_updateProperties") {
{
auto collection0Json = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection\" }");
auto collection1Json = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testCollection1\", \"id\": \"123\" }");
auto viewJson = arangodb::velocypack::Parser::fromJson("{ \"id\": \"42\", \"name\": \"testView\", \"type\": \"arangosearch\", \"properties\": { \"collections\": [ 3, 4, 5 ], \"commit\": { \"cleanupIntervalStep\": 24, \"commitIntervalMsec\": 42 } } }");
auto viewJson = arangodb::velocypack::Parser::fromJson("{ \"id\": \"42\", \"name\": \"testView\", \"type\": \"arangosearch\", \"collections\": [ 3, 4, 5 ], \"commit\": { \"cleanupIntervalStep\": 24, \"commitIntervalMsec\": 42 } }");
TRI_vocbase_t* vocbase; // will be owned by DatabaseFeature
REQUIRE((TRI_ERROR_NO_ERROR == databaseFeature->createDatabase(0, "testDatabase" TOSTRING(__LINE__), vocbase)));
REQUIRE((nullptr != vocbase));
@ -1320,9 +1289,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((2U == slice.length()));
CHECK((5U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 24 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1331,7 +1298,7 @@ SECTION("test_updateProperties") {
}
{
auto update = arangodb::velocypack::Parser::fromJson("{ \"properties\": { \"collections\": [ 6, 7, 8 ], \"links\": { \"testCollection\": {} }, \"commit\": { \"commitIntervalMsec\": 52 } } }");
auto update = arangodb::velocypack::Parser::fromJson("{ \"collections\": [ 6, 7, 8 ], \"links\": { \"testCollection\": {} }, \"commit\": { \"commitIntervalMsec\": 52 } }");
CHECK((true == wiew->updateProperties(update->slice(), false, true).ok()));
}
@ -1344,9 +1311,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((2U == slice.length()));
CHECK((5U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 10 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1366,9 +1331,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((3U == slice.length()));
CHECK((6U == slice.length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");
CHECK((tmpSlice.hasKey("cleanupIntervalStep") && tmpSlice.get("cleanupIntervalStep").isNumber<size_t>() && 10 == tmpSlice.get("cleanupIntervalStep").getNumber<size_t>()));
@ -1386,10 +1349,7 @@ SECTION("test_updateProperties") {
auto slice = builder.slice();
CHECK((slice.isObject()));
CHECK((8U == slice.length()));
slice = slice.get("properties");
CHECK((slice.isObject()));
CHECK((3U == slice.length()));
CHECK((10U == slice.length()));
CHECK((slice.hasKey("collections") && slice.get("collections").isArray() && 0 == slice.get("collections").length()));
CHECK((slice.hasKey("commit") && slice.get("commit").isObject()));
auto tmpSlice = slice.get("commit");

View File

@ -662,11 +662,11 @@ SECTION("collections") {
// link collections
auto updateJson = arangodb::velocypack::Parser::fromJson(
"{ \"properties\": { \"links\": {"
"{ \"links\": {"
"\"testCollection0\": { \"includeAllFields\": true, \"trackListPositions\": true },"
"\"testCollection1\": { \"includeAllFields\": true },"
"\"testCollection2\": { \"includeAllFields\": true }"
"}}}"
"}}"
);
CHECK((logicalView->updateProperties(updateJson->slice(), true, false).ok()));
@ -818,3 +818,7 @@ SECTION("createBlockCoordinator") {
}
}
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------