YiiRedis icon indicating copy to clipboard operation
YiiRedis copied to clipboard

ARedisRecord need find and findAll functions

Open sanjaysamalla opened this issue 11 years ago • 4 comments

Can you please tell us is their any find and findAll related function available in ARedisRecord.php as in Cactiverecord class?

sanjaysamalla avatar Aug 05 '13 10:08 sanjaysamalla

is there any one to help?

sanjaysamalla avatar Aug 06 '13 06:08 sanjaysamalla

As I see there are only "findByPk" and "findAllByPk" functions available.

Example: $record = ARedisRecord::model()->findByPk(1);

vgoodvin avatar Aug 06 '13 07:08 vgoodvin

we need find by attribute kind of this in yii redis. i couldnt find it. :( .

sanjaysamalla avatar Aug 06 '13 07:08 sanjaysamalla

Redis is a key-value store, not a relational database. It doesn't support searching key by value. You can manually create an index "attribute value" => "id" to search model ID using redis and then load model through findByPk().

vgoodvin avatar Aug 06 '13 07:08 vgoodvin