Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Fixed #692: leveraging search:parse to evaluate if's against properties #817

Merged

Conversation

grtjn
Copy link
Contributor

@grtjn grtjn commented Jun 15, 2017

Fixes #692.

Adds support to use an if attribute with a boolean expression on any config element, even the root (configuration). It allows expressions like:

  • prop EQ val
  • prop NE val
  • prop LT val
  • prop LE val
  • prop GT val
  • prop GE val
  • -(prop EQ val)
  • prop1 EQ val1 OR prop1 EQ val2
  • prop1 EQ val1 AND prop2 EQ val2
  • prop1 EQ val1 AND (prop2 EQ val2 OR prop2 EQ val2)
  • prop1 EQ val1 AND -(prop2 EQ val2 OR prop2 EQ val2)

Minus represents NOT. For property names one uses the exact names from ml info, but without ml., nor @ or $. E.g.: if="environment EQ local"

@RobertSzkutak
Copy link
Contributor

RobertSzkutak commented Aug 4, 2017

From my testing and read of the code I'm very confident the parser and evaluation doesn't execute without detecting an if attribute. Basic test cases I tried all appeared to work. Feel comfortable merging this. AWESOME feature!

@RobertSzkutak RobertSzkutak merged commit 62b9add into marklogic-community:dev Aug 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants