ruby on rails - Neo4j gem - Querying multiple parameters in one property -
i'm not sure if title best description.
i'm building basic filtering capabilities via form events. events have category select drop down.
now when want filter, can select via checkboxes categories want display.
i'm bit stumped how that. possible in 1 query? or separate 1 each category?
my old query current_user.friends.events(:event, :rel).where("rel.admin = {admin_p} , event.detail = {detail_p}").params(admin_p: true, detail_p: true).pluck(:event)
in case, need event.category = category1, category2, cateogry3
. isn't how it's written. ways achieve this?
in cypher, in
lets match results within array.
match (u:user)-[r1:invited_to]->(e:event) e.uuid in [1, 2, 3, 4, 5] return e
that match events of uuid properties in array. in ruby gem, handled automatically in queryproxy if use array in method.
current_user.events.where(category: [1, 2, 3, 4, 5])
in form, ensure each checkbox's value corresponds id. put ids array , search demonstrated above.
Comments
Post a Comment