Hi,
I've submitted a proposed enhancement for the indexByPrimaryKey
function, for the version 10.3.0(the release after next). You can
follow the request here:
https://sourceforge.net/tracker/?func=3Dadd&group_id=3D111915&atid=3D660740
Just for convenience here the body of the RFE is below. My intention
is to modify the existing function, rather than introduce a new one...
It would be very useful to extend the indexByPrimaryKey function to
support multiple primary keys at the same time, e.g.
var index =3D records.indexByPrimaryKey( "key1", "key2" );
index[ "key1value" ][ "key2value" ];
suchthat only one record can exist for any combination of primary key
field values. This would help to avoid the common situation where you
know this to be the case but have to use the group function instead,
thus:
var index =3D records.group( "key1", "key2" );
index[ "key1value" ][ "key2value"][ 1 ];
It's only a subtle change, but it does make the code neater.
|