![]() The first results our team came across while looking into this was using PostgreSQL native functions and operators. Notably, we want to be able to support operators of "in" and "not in" when querying for data, as opposed to operators such as "equals", "not equals", "greater than or equals", etc. To do so, we need to investigate how to make precise queries on a set of data within a JSONB field in PostgreSQL, and subsequently how we can turn those queries into composable Ecto queries within our Elixir application as well. The queries we need to write need to work for both "at least one leg of a sportsbook contains" and "none of the legs of a sportsbook bet can contain" scenarios. This would require looking for a sportsbook bet that does not have an event_id corresponding to the Super Bowl for the previous year in any of its legs. Similarly, the audience criteria also needs to support scenarios where "The patron has placed a sportsbook bet that was not on last years Super Bowl" as well. For the last example, it requires querying the JSONB attributes field to determine if any of the "legs" on any of the users previous sportsbook bets contain the event_id associated with last years Super Bowl.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |