Skip to content

Conversation

@nmaludy
Copy link
Member

@nmaludy nmaludy commented Sep 29, 2017

This is the corresponding PR to
StackStorm/st2#3766 that adds documentation on the new filters.

v2.1, the expression to access key ``foo`` from datastore used to be ``{{ system.foo }}``
but is now deprecated, and the leading ``st2kv.`` namespace is required.

Currently, all data in the datastore is represented as strings. Toto represent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toto -> To typo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

# {'first': 'Jacob', 'last': 'e'},
# {'first': 'Jayden', 'last': 'f'}]}
# result = ['James', 'Jacob', 'Jayden']
{{ input | jmespath_query('people[*].first') }}
Copy link
Member

@arm4b arm4b Sep 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for such complex filter we need several more examples to show how powerful it is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Added more examples.

Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

#
# input = {'animals': ['bird', 'rabbit', 'cat', 'dog', 'cow'] }
# result = ['bird', 'rabbit', 'cat', 'dog', 'cow']
{{ input | jsonpath_query('animals[*]') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on the docs and examples 👍

.. code-block:: bash
{{version | version_strip_patch}}
{{ version | version_strip_patch }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'm also not a fan of non-whitespace approach :P

@Kami Kami merged commit 0193cad into StackStorm:master Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants