私は次のものを持っています:
ydbStorage = 新しい ydn.db.Storage(dbName, スキーマ);
/**
@param values - An array of keys . e.g. ['account1', 'city1']
@param index - An string of index value . e.g. 'account, city'
@description - Get records based on compound index. Remember that indexes are not created for boolean values
*/
var getRecordsOnCompoundIndex = function(store_name, index, values, success_callback, failure_callback) {
console.log('Inside getRecordsOnCompoundIndex');
if(!store_name || ! index || !values) {
failure_callback();
} else {
var keyRange = ydn.db.KeyRange.only(values);
ydbStorage.values(new ydn.db.IndexValueIterator(store_name, index, keyRange)).done(function(response) {
if(!response){
failure_callback();
}else{
success_callback(response);
}
});
}
}
$scope.getAccountKeyContact = function() {
var indexes = 'Account__c,PrimaryContact__c';
var values = [accountId, "true"];
ydbDatabase.getRecordsOnCompoundIndex('contactRole', indexes, values, function(records) {
//console.log('KeyContact role is : ', records);
ydbDatabase.getRecordOnId('contacts', records[0].Contact__c, function(record) {
$scope.outlet.keyContact = record;
$scope.outlet.keyContact.designation = records[0].Role__c;
$scope.$apply();
}, function() {
console.log('Could not get KeyContact');
});
}, function() {
console.log('Could not get contactRole Role');
});
}
複合インデックスが存在するにもかかわらず、次のエラーが発生します。
Uncaught ydn.error.ArgumentException: 必要なインデックス "Account__c,PrimaryContact__c" がストア "contactRole" に見つかりません
何が悪いのかわかりません。助言がありますか。エラーは行 ydbDatabase.getRecordsOnCompoundIndex にあります