nickva commented on code in PR #5869:
URL: https://github.com/apache/couchdb/pull/5869#discussion_r2954422414


##########
src/mango/src/mango_selector.erl:
##########
@@ -575,7 +574,9 @@ match({[_, _ | _] = _Props} = Sel, _Value, _Cmp) ->
 % match against.
 
 has_required_fields(Selector, RequiredFields) ->
-    Remainder = has_required_fields_int(Selector, RequiredFields),
+    Paths0 = [mango_util:parse_field(F) || F <- RequiredFields],
+    Paths = [P || {ok, P} <- Paths0],

Review Comment:
   Yeah that works, nicely.
   
   Btw in OTP 28 they fixed this corner case with a new exact generator syntax!
   
   old hiding behavior
   ```
   > [X || {ok, X} <- [{ok, 1}, {not_ok, 2}]].
   [1]
   ```
   
   new exact generator
   ```
   > [X ||{ok, X} <:- [{ok, 1}, {not_ok, 2}]].
   * exception error: no match of right hand side value {not_ok,2}
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to