I have the following:
ydbStorage = new ydn.db.Storage(dbName, schema);
/**
@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');
});
}

I am getting the following error in spite of the compound index being present.
Uncaught ydn.error.ArgumentException: require index "Account__c,PrimaryContact__c" not found in store "contactRole"
Can't figure out what is wrong. Any suggestions. The error is with the line ydbDatabase.getRecordsOnCompoundIndex
Are you sure you have compound index as describe here. It should be something like: