queryLogic
Configuration for list comparison, instance identification and membership
calculations. A way for the can-connect
behaviors to understand what the properties of a request mean and act
on them.
can-query-logic
A queryLogic that is used to perform calculations using set definition objects passed to getListData and getList. Needed to enable caching, request combining, real-time and other behaviors. By default no queryLogic is provided.
An example of the types of calculations behaviors will make using the queryLogic:
var queryLogic = new QueryLogic({
identity: ['_uid'],
keys: {
_uid: Number
}
});
var todoConnection = connect([...behaviors...],{
queryLogic: queryLogic
});
todoConnection.queryLogic.memberIdentity({_uid: 5, ...}); //-> 5
todoConnection.id({_uid: 5, ...}); //-> 5
todoConnection.queryLogic.intersection(
{page: {first: 0, last: 10}},
{page: {first: d5, last: 20}}); //-> {first:5, last:10}