From 20675f9d3420b5cc31c7a98bc2aee83e6d24e792 Mon Sep 17 00:00:00 2001 From: David Feng Date: Fri, 5 Feb 2021 11:54:57 -0500 Subject: [PATCH] allowed undefined keys to appear in query --- jp/get.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jp/get.go b/jp/get.go index c823232..6ae32f4 100644 --- a/jp/get.go +++ b/jp/get.go @@ -59,7 +59,10 @@ func (x Expr) Get(data interface{}) (results []interface{}) { switch tv := prev.(type) { case nil: case map[string]interface{}: - v, has = tv[string(tf)] + v = tv[string(tf)] + + // always enable to allow for undefined data elements + has = true case gen.Object: v, has = tv[string(tf)] default: