Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
asset.query :where "namespace='/projects/Data Teammyproject' and name='*.PNG'"


If you wish to search /projects/Data Team and all folders underneath it, use:

Code Block
asset.query :namespace "/projects/Data Teammyproject" :where "name='*.PNG'"


Searching for all assets that were created after a certain date would be done as follows:

Code Block
asset.query :namespace "/projects/Data Teammyproject" :where "ctime>='01-Jan-2017'"

...

If one of the elements in mytype was location (which is of type string), then here is how to search for a particular value:

Code Block
asset.query :namespace "/projects/myproject" :where "xpath(mytype/location) = 'Perth' and namespace>='/projects/myproject'"


Getting more information from the results

...

To get the name of the asset as well, use:

Code Block
asset.query :wherenamespace "namespace>='/projects/Data Team' and myproject" :where "name='*.PNG'" :action get-name

...

To get arbitrary pieces of metadata, for example the name and checksum, use:

Code Block
asset.query :wherenamespace "namespace>='/projects/Data Team' and myproject" :where "name='*.PNG'" :action get-value :xpath name :xpath content/csum

...

To associate a better name with the returned metadata item, use something like:

Code Block
asset.query :wherenamespace "namespace>='/projects/Data Team' and myproject" :where "name='*.PNG'" :action get-value :xpath -ename checksum content/csum

...