Compute - Value Backups
Compute - Value Backups
// this method will declare all the collection name with proper dbCount
let collection_array = [
`c1_060_${dbCount}`,
`c2_060_${dbCount}`,
`c3_insert_060_${dbCount}`,
`c4_update_060_${dbCount}`,
`c5_replace_060_${dbCount}`,
`c6_not_null_060_${dbCount}`,
`c7_hex_060_${dbCount}`,
`c8_overwriteFalse_060_${dbCount}`,
`c9_overwriteTrue_060_${dbCount}`,
`c10_multiple_060_${dbCount}`,
`c11_060_${dbCount}`,
`c12_060_${dbCount}`
];
return collection_array;
};
// this method will declare all the views name with proper dbCount
let views_Name_array = [
`test_view_${dbCount}`,
`test_view2_${dbCount}`
];
return views_Name_array;
};
// This method will take db and a tuple parameter containing one query and one
expected output
//execute queries which use indexes and verify that the proper amount of docs are
returned
function index_array(dbCount){
let c = collection_declaration(dbCount);
let index_tuple = [
];
return index_tuple;
function views_array(dbCount) {
// get all the view's variable name from the variable_name_declaration method
globally
let view_tuples = [
[`for doc in ${view[0]} filter doc.cv_field == CONCAT(doc._key, ' ', doc._id, '
', doc._rev) collect with count into c return c`, 64000],
[`for doc in ${view[1]} search doc.cv_field == SOUNDEX('sky') collect with
count into c return c`, 64000],
[`for doc in ${view[1]} search doc.cv_field == not null collect with count into
c return c`, 64000],
[`for doc in ${view[1]} filter doc.cv_field == CONCAT(doc._key, ' ', doc._id, '
', doc._rev) collect with count into c return c`, 64000]
return view_tuples;
(function () {
const a = require("@arangodb/analyzers");
return {
},
let c = collection_declaration(dbCount);
if (obj1.hasOwnProperty('optimizeTopK')) {
delete obj1.optimizeTopK;
if (obj2.hasOwnProperty('optimizeTopK')) {
delete obj2.optimizeTopK;
//for c1 comVal
let c1_exp_modification = [
name: 'cv_field',
overwrite: true,
failOnWarning: false,
keepNull: true
];
let c1_actual_modification = c1.properties({ computedValues: [{ "name":
"cv_field", "expression": "RETURN SOUNDEX('sky')", overwrite: true }] });
checkComValProperties(c[0], c1_exp_modification,
c1_actual_modification.computedValues);
//for c2 comVal
let c2_exp_modification = [
name: 'cv_field',
overwrite: true,
failOnWarning: false,
keepNull: true
];
checkComValProperties(c[1], c2_exp_modification,
c2_actual_modification.computedValues);
let c3_exp_modification = [
name: 'cv_field_insert',
computeOn: [ 'insert' ],
overwrite: true,
failOnWarning: false,
keepNull: true
];
checkComValProperties(c[2], c3_exp_modification,
c3_actual_modification.computedValues);
let c4_exp_modification = [
name: 'cv_field_update',
computeOn: [ 'update' ],
overwrite: true,
failOnWarning: false,
keepNull: true
];
checkComValProperties(c[3], c4_exp_modification,
c4_actual_modification.computedValues);
let c5_exp_modification = [
{
name: 'cv_field_replace',
computeOn: [ 'replace' ],
overwrite: true,
failOnWarning: false,
keepNull: true
];
checkComValProperties(c[4], c5_exp_modification,
c5_actual_modification.computedValues);
let c6_exp_modification = [
name: 'cv_field',
overwrite: true,
failOnWarning: false,
keepNull: false
];
let c7_exp_modification = [
name: 'cv_field',
overwrite: true,
failOnWarning: false,
keepNull: true
];
checkComValProperties(c[6], c7_exp_modification,
c7_actual_modification.computedValues);
let c8_exp_modification = [
name: 'cv_field',
overwrite: false,
failOnWarning: false,
keepNull: true
}
];
checkComValProperties(c[7], c8_exp_modification,
c8_actual_modification.computedValues);
let c9_exp_modification = [
name: 'cv_field',
overwrite: true,
failOnWarning: false,
keepNull: true
];
checkComValProperties(c[8], c9_exp_modification,
c9_actual_modification.computedValues);
let c10_exp_modification = [
name: 'cv_field1',
expression: "RETURN 'foo'",
overwrite: true,
failOnWarning: false,
keepNull: true
},
name: 'cv_field2',
overwrite: true,
failOnWarning: false,
keepNull: true
},
name: 'cv_field3',
overwrite: true,
failOnWarning: false,
keepNull: true
];
checkComValProperties(c[9], c10_exp_modification,
c10_actual_modification.computedValues);
//for c11 comVal
let c11_exp_modification = [
name: 'cv_field',
overwrite: true,
failOnWarning: false,
keepNull: true
];
checkComValProperties(c[10], c11_exp_modification,
c11_actual_modification.computedValues);
let c12_exp_modification = [
name: 'cv_field',
overwrite: true,
failOnWarning: false,
keepNull: true
}
];
checkComValProperties(c[11], c12_exp_modification,
c12_actual_modification.computedValues);
//-------------------------------------------------------
x-------------------------------------------------------------
c1.ensureIndex({"type":"inverted","name":"inverted","fields":
[{"name":"cv_field"}]});
c1.ensureIndex({"type":"persistent","name":"persistent","fields":
["cv_field"], "sparse": true});
c2.ensureIndex({"type":"inverted","name":"inverted","fields":
[{"name":"cv_field"}]});
c2.ensureIndex({"type":"persistent","name":"persistent","fields":
["cv_field"], "sparse": true});
c3.ensureIndex({"type":"inverted","name":"inverted","fields":[{"name":
"cv_field_insert"}]});
c3.ensureIndex({"type":"persistent","name":"persistent","fields":
["cv_field_insert"], "sparse": true});
c4.ensureIndex({"type":"inverted","name":"inverted","fields":
[{"name":"cv_field_update"}]});
c4.ensureIndex({"type":"persistent","name":"persistent","fields":
["cv_field_update"], "sparse": true});
c5.ensureIndex({"type":"inverted","name":"inverted","fields":
[{"name":"cv_field_replace"}]});
c5.ensureIndex({"type":"persistent","name":"persistent","fields":
["cv_field_replace"], "sparse": true});
c6.ensureIndex({"type":"inverted","name":"inverted","fields":
[{"name":"cv_field"}]});
c6.ensureIndex({"type":"persistent","name":"persistent","fields":
["cv_field"], "sparse": true});
c7.ensureIndex({"type":"inverted","name":"inverted","fields":
[{"name":"cv_field"}]});
c7.ensureIndex({"type":"persistent","name":"persistent","fields":
["cv_field"], "sparse": true});
c8.ensureIndex({"type":"inverted","name":"inverted","fields":
[{"name":"cv_field"}]});
c8.ensureIndex({"type":"persistent","name":"persistent","fields":
["cv_field"], "sparse": true});
c9.ensureIndex({"type":"inverted","name":"inverted","fields":
[{"name":"cv_field"}]});
c9.ensureIndex({"type":"persistent","name":"persistent","fields":
["cv_field"], "sparse": true});
c10.ensureIndex({"type":"inverted","name":"inverted","fields":
[{"name":"cv_field1"},{"name":"cv_field2"},{"name":"cv_field3"}]});
c10.ensureIndex({"type":"persistent","name":"persistent","fields":
["cv_field1", "cv_field2", "cv_field3"], "sparse": true});
c11.ensureIndex({"type":"inverted","name":"inverted","fields":
[{"name":"cv_field"}]});
c11.ensureIndex({"type":"persistent","name":"persistent","fields":
["cv_field"], "sparse": true});
c12.ensureIndex({"type":"inverted","name":"inverted","fields":
[{"name":"cv_field", "nested": ["from_doc"]}]});
//-------------------------------------------------------
x-------------------------------------------------------------
// get all the view's variable name from the variable_name_declaration method
globally
db._createView(view[0], "arangosearch");
{"links":{
});
let expected_output = {
"cleanupIntervalStep" : 2,
"commitIntervalMsec" : 1000,
"consolidationIntervalMsec" : 1000,
"consolidationPolicy" : {
"type" : "tier",
"segmentsBytesFloor" : 2097152,
"segmentsBytesMax" : 5368709120,
"segmentsMax" : 10,
"segmentsMin" : 1,
"minScore" : 0
},
"primarySort" : [ ],
"primarySortCompression" : "lz4",
"storedValues" : [ ],
"writebufferActive" : 0,
"writebufferIdle" : 64,
"writebufferSizeMax" : 33554432,
"links" : {
[c[0]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
},
[c[1]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
},
[c[2]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
},
[c[3]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
},
[c[4]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
},
[c[5]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
},
[c[6]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
},
[c[7]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
},
[c[8]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
},
[c[9]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
},
[c[10]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
},
[c[11]] : {
"analyzers" : [
"identity"
],
"fields" : {
"cv_field" : {
},
"includeAllFields" : true,
"storeValues" : "none",
"trackListPositions" : false
"indexes": [
'collection': c[0],
'index': 'inverted'
},
'collection': c[1],
'index': 'inverted'
},
'collection': c[2],
'index': 'inverted'
},
'collection': c[3],
'index': 'inverted'
},
'collection': c[4],
'index': 'inverted'
},
'collection': c[5],
'index': 'inverted'
},
'collection': c[6],
'index': 'inverted'
},
'collection': c[7],
'index': 'inverted'
},
'collection': c[8],
'index': 'inverted'
},
'collection': c[9],
'index': 'inverted'
},
'collection': c[10],
'index': 'inverted'
},
'collection': c[11],
'index': 'inverted'
})
//-------------------------------------------------------
x-------------------------------------------------------------
let data_array = [c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12];
data_array.forEach(col => {
}else{
});
//execute queries which use views and verify that the proper amount of docs
are returned
result_comparision(db, index_tuple);
//execute queries which use views and verify that the proper amount of docs
are returned
result_comparision(db, viewTuple);
return 0;
},
//execute queries which use views and verify that the proper amount of docs
are returned
result_comparision(db, index_tuple);
//execute queries which use views and verify that the proper amount of docs
are returned
result_comparision(db, viewTuple);
return 0;
},
// get all the view's variable name from the variable_name_declaration method
globally
try {
db._dropView(`${view[0]}`);
db._dropView(`${view[1]}`);
} catch (error) {
throw error;
let c = collection_declaration(dbCount);
c.forEach(col => {
db[col].properties({computedValues: []})
if (db[col].properties()["computedValues"] == null) {
db._drop(col);
} else {
})
return 0;
};
}());