Back to problems

Predicate and Expression Tree Evaluator

Algorithm · Mongodb · Medium

Build an evaluator for a small predicate language whose behavior mirrors the WHERE clause of a SQL query. You are given a JSON object document alongside a predicate expression predicate, and your job is to implement: Predicates can be nested to arbitrary depth and make use of four operations: EQ(field, value) — holds when the value stored at document[field] is equal to value. GT(field, value) — holds when the value stored at document[field] is greater than value.…

Loading the rest of the question…