Have a question? Want to report an issue? Contact JFrog support

Versions Compared

Key

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

...

Code Block
//This example shows both an implicit "$and" operator (since this is the default, you don't have to expressly specify it, but rather separate the criteria by a comma), and an explicit "$or" operator. 
//Find all items that are files and are in either the jcenter or my-local repositories. 
items.find({"type" : "file","$or":[{"repo" : "jcenter", "repo" : "my-local" }]})

//Find all the items that were created in a build called "my_debian_build" and whose name ends with ".deb" or areall items created in a build called "my_yum_build" and whose name ends with ".rpm".
items.find(
	{
		"$or":
		[
			{
				"$and":
				[
					{"artifact.module.build.name" : "my_debian_build"} ,
					{"name" : {"$match" : "*.deb"}}
				]
			}, 
			{
				"$and":
				[
					{"artifact.module.build.name" : "my_yum_build"} ,
					{"name" : {"$match" : "*.rpm"}}
				]
			}
		]
	}
)
  
//Find all items in a repository called "my_local" that have a property with a key called "license" and value that is any variant of "LGPL".
items.find({"repo" : "my_local"},{"@artifactory.licenses" : {"$match" : "*LGPL*"}})
 

...