Skip to content

How to search in a list? #47

Description

@avico78

I see a key pointing to list of json :

redis_json_client.jsonset('customers', Path.rootPath(), { "customers": []})

example of insreted json
customer_json:

 {
  "customer_status": "Active",
  "first_name": "Leonard",
  "last_name": "Cohen",
  "customer_no": 1
}

So now I append each of the json as following:

redis_json_client.jsonarrappend('customers', Path('.customers'), customer_json)

I'd like to preform a search finding specific customer_no
I tried something like:

customer_redis = redis_json_client.jsonget('customers', Path('customer_no'),370471789)

Q:
1.The reaosn for creating a list of json is that i'd like to some category collection in redis
,i wonder how bad it effect the performance ,
I could also assign the json as :
key,customer_json instead of key,[customer_json]

2.How could i preform a search for specific json where key holds a list of json as desribe above?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions