diff --git a/community/go-engines-community/lib/api/pbehavior/store.go b/community/go-engines-community/lib/api/pbehavior/store.go index 2ed605c64a..d9e3f6712f 100644 --- a/community/go-engines-community/lib/api/pbehavior/store.go +++ b/community/go-engines-community/lib/api/pbehavior/store.go @@ -667,7 +667,10 @@ func (s *store) EntityDelete(ctx context.Context, r BulkEntityDeleteRequestItem) "entity": r.Entity, "origin": r.Origin, "tstart": bson.M{"$lte": now}, - "tstop": bson.M{"$gte": now}, + "$or": bson.A{ + bson.M{"tstop": nil}, + bson.M{"tstop": bson.M{"$gte": now}}, + }, }, options.FindOneAndDelete().SetProjection(bson.M{"_id": 1})). Decode(&pbh) if err != nil { diff --git a/community/go-engines-community/lib/api/serviceweather/mongo_query.go b/community/go-engines-community/lib/api/serviceweather/mongo_query.go index 16beb35a32..100412bfa9 100644 --- a/community/go-engines-community/lib/api/serviceweather/mongo_query.go +++ b/community/go-engines-community/lib/api/serviceweather/mongo_query.go @@ -616,7 +616,10 @@ func getPbhOriginLookup(origin string, now datetime.CpsTime) []bson.M { {"$match": bson.M{ "origin": origin, "tstart": bson.M{"$lte": now}, - "tstop": bson.M{"$gte": now}, + "$or": bson.A{ + bson.M{"tstop": nil}, + bson.M{"tstop": bson.M{"$gte": now}}, + }, }}, {"$limit": 1}, },